简体   繁体   English

使用remoteSort在哪种商店上触发了什么方法?

[英]What method is fired on sort of store using remoteSort?

I sort of inherited a mess and only have a short time to fix it. 我有点继承了一个烂摊子,只有很短的时间来解决它。 My issue is that I am trying to fix a bug where we are using a store/grid with infinite scrolling. 我的问题是,我正在尝试修复一个错误,即我们使用无限滚动的存储/网格。 When a user tries to sort the grid a "loading" message appears and that is it. 当用户尝试对网格进行排序时,将显示“正在加载”消息。

I have put breakpoints serverside and it is calling back to the server fine and passing the correct columns but it does not ever take the "loading" message off. 我在服务器端设置了断点,它可以正常调用服务器并传递正确的列,但是它永远不会消除“正在加载”消息。

I am looking for what event I should watch for on the clientside before and after the sort is fired. 我正在寻找在触发排序前后在客户端应注意的事件。 I have console.log statements in load, beforesync and just about everything else on the store (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.Store) perhaps there is something I need to listen for on the grid? 我可能正在加载console.log语句,beforesync和商店中的所有其他内容(http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.Store)是我需要在网格上听的东西吗?

Here is the logs from the prefetch overriding and console.logs... 这是来自预取覆盖和console.logs的日志...

grid store event: ["beforeload", i, Object]
pageSize = 100
grid store event: ["beforeprefetch", i,i]
before prefetch done 
proxy.read done 
end of prefetch 
grid panel event: ["sortchange", i, i, "DESC"]
grid panel event: ["beforestatesave", i, Object]
grid store event: ["totalcountchange", 2] BufferedStore.js:22
grid store event: ["prefetch", i, Array[2], true,i]

The 'sortchange' event should fire on the grid. “ sortchange”事件应在网格上触发。 The 'beforeload' event should fire before the call to the service is made to get new data. 在调用服务获取新数据之前,应触发“ beforeload”事件。 The 'load' event should fire once the data comes back from the service call. 一旦数据从服务调用返回,就会触发“加载”事件。

To debug deeper, after your grid is created and you have a reference to it, say for instance 'rolocGrid', you can then use the Observable utility to monitor all events on the grid and it's store. 要进行更深入的调试,请在创建网格并对其进行引用之后,例如说说“ rolocGrid”,然后可以使用Observable实用程序监视网格及其存储上的所有事件。

This snippet will write to the console for each event to give you insight into what happens in the process: 该代码段将针对每个事件写入控制台,以使您深入了解过程中发生的情况:

 Ext.util.Observable.capture(rolocGrid.store, function () { console.log('grid store event:', arguments)}, rolocGrid);                                           
 Ext.util.Observable.capture(rolocGrid, function () { console.log('grid event:', arguments)}, rolocGrid);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM