in a list's init event, pass the query if the async items function immediately returns one
This commit is contained in:
parent
5227dbc166
commit
2a7c20a043
1 changed files with 7 additions and 2 deletions
|
@ -1392,8 +1392,9 @@ Ox.List = function(options, self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateQuery(callback) { // fixme: shouldn't this be setQuery?
|
function updateQuery(callback) { // fixme: shouldn't this be setQuery?
|
||||||
|
var data;
|
||||||
clear(); // fixme: bad function name ... clear what?
|
clear(); // fixme: bad function name ... clear what?
|
||||||
self.requests.push(self.options.items({
|
self.requests.push(data = self.options.items({
|
||||||
query: self.options.query
|
query: self.options.query
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
var keys = {};
|
var keys = {};
|
||||||
|
@ -1402,7 +1403,11 @@ Ox.List = function(options, self) {
|
||||||
// and before any sizes can be determined via the DOM
|
// and before any sizes can be determined via the DOM
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
that.triggerEvent(
|
that.triggerEvent(
|
||||||
'init', Ox.extend(result.data, {query: self.options.query})
|
'init',
|
||||||
|
Ox.extend(
|
||||||
|
result.data,
|
||||||
|
data && data.query ? {query: data.query} : {}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
self.rowLength = getRowLength();
|
self.rowLength = getRowLength();
|
||||||
self.pageLength = self.options.orientation == 'both'
|
self.pageLength = self.options.orientation == 'both'
|
||||||
|
|
Loading…
Reference in a new issue