PDA

View Full Version : Refresh button on PagingToolbar keeps spinning upon aborted request



borg
30 Nov 2009, 10:54 AM
Here's what happens when I cancel:


if (grid.rendered) {
grid.loadMask.hide();
}
store.proxy.conn.abort();

However, the refresh button on the PagingToolbar doesn't switch back from the loading animation to the refresh icon. I imagine it has something to do with the connection not telling the store that the connection was closed. Firebug shows the connection as waiting for a response too. How do I actually cancel the request??


var proxy = new Ext.data.HttpProxy(
new Ext.data.Connection({
url: 'get-grid-data.php',
autoAbort: true
})
);

var store = new Ext.data.JsonStore({
totalProperty: 'total',
root: 'rows',
proxy: proxy,
fields:['t','c','r','y'],
sortInfo: {field: 't', direction: 'ASC'}
});

var pagingBar = new Ext.PagingToolbar({
store: store,
pageSize: pagingLimit,
displayInfo: true,
emptyMsg: "No topics to display",
// the below code bypasses the problem but isn't ideal since the connection still isn't updating the pagingtoolbar, by removing the refresh button. note that in ext3 it's "refresh" and in ext2 it's "loading"
listeners: {
render: function(c){
c.refresh.hideParent = true;
c.refresh.hide();
}
}
});

var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{id: 'title', renderer: renderTopic, header: 'Title', width: 500, sortable: true, dataIndex: 't'},
{header: 'Catalog Number', width: 100, sortable: true, dataIndex: 'c', align: 'center'},
{header: 'Run Time', width: 70, sortable: true, dataIndex: 'r', align: 'center'},
{header: 'Year Produced', width: 100, sortable: true, dataIndex: 'y', align: 'center'}
],
cls: 'grid',
loadMask: true,
trackMouseOver: true,
stripeRows: true,
autoExpandColumn: 'title',
tbar: pagingBar
});

borg
8 Dec 2009, 10:28 AM
Still waiting for an answer on how to actually abort a request