我正在使用 dojox.grid.DataGrid 和 dojox.data.QueryReadStore。我在客户端有以下代码:
var store = new dojox.data.QueryReadStore({url:"<?php echo $this->url(array("action"=>"load-plans")) ?>"});
//var store = new dojo.data.ItemFileWriteStore({url:"<?php echo $this->url(array("action"=>"load-plans")) ?>"});
/*set up layout*/
var layout = [[
{name: 'Plan Name', field: 'title', width: '100px'},
{name: 'User', field: 'email', width: '150px',get: formatEmail},
{name: 'Status', field: 'percentage_completed', width: '100px'},
{name: 'Word Count', field: 'word_count', width: '50px'},
{name: 'Revenue Entries', field: 'revenue_count', width: '50px'},
{name: 'Expense Entries', field: 'expense_count', width: '50px'},
{name: 'Fund Entries', field: 'funds_count', width: '60px'},
{name: 'Total Profit', field: 'total_profit', width: '60px'},
{name: 'Total Funding', field: 'total_funding', width: '60px'},
{name: 'Template Used', field: 'template_title', width: '100px'},
{name: 'Last modified', field: 'updated_at', width: '100px'},
]];
/*create a new grid:*/
grid = new dojox.grid.DataGrid({
id: 'plan-grid',
store: store,
structure: layout,
escapeHTMLInData: false
},
在服务器端:$data = $availableMerchants->getList($sort, $order, $start, $limit)->toArray();
$dojoData = new Zend_Dojo_Data('id', $data, 'id');
$this->getResponse()->setHeader('Content-Range', "items $start-$limit/302");
echo $dojoData->toJson();
但是当我滚动虚拟分页时,它不起作用。它只发出 start=0&count=25 的第一个请求,而不发出进一步的请求。
请帮忙。