When i am using multiple url within proxy for GridPanel,Data is not loaded in the grid but when i open javascript console from crome, it is being load.
i am using below.
storename.getProxy().url = 'myurl';
How to resolve this issue?
Thanks in advance.
i hope after you're setting the proxy
storename.getProxy().url = 'myurl';
you load the store again
storename.load();
and about the store, does it have an url initially, does it have autoLoad.. just post some code dude!!
i think put layout: 'fit' in parent container of GridPanel will solve this issue too.
Related
I am trying to apply an enhancement on below code line. If anyone knows solution, please help me!
loaderMask = new CQ.Ext.LoadMask(CQ.Ext.getBody(), { msg:"Loading... Please wait"})
loaderMask.show();
This loader mask is fixed in the page position and I like to fix it on the user screen while user scrolls up or down on the page.
Thankyou!
That would be:
scrollPanel.getScrollable().on('scrollstart', function(){
scrollPanel.mask({message: 'scrolling'});
});
scrollPanel.getScrollable().on('scrollend', function(){
scrollPanel.unmask();
});
But it sounds more like, you are loading data and while loading you want to mask the container. If so you might want to listen to the beforeLoad and load event of the store and mask and unmask while it is loading.
The alternative is to use databinding to the store.loading.
If you want to know more about that, please setup a fiddle (fiddle.sencha.com).
I want to mask only my grid component, when the data is getting loaded. But on load mask , the whole window gets masked.Please suggest the necessary changes to achieve this behavior.
You can access the code in the below fiddle path, provided.
https://fiddle.sencha.com/#fiddle/fti
Thank You...
You can call grid.setLoading(true) or grid.setLoading('Custom Message') if you have a reference to the grid.
Link to Doc
Try this:
var gridPanel = new Ext.grid.Panel({
...
viewConfig: {
loadMask: true
},
...
});
Hope that helps.
I'm using Ext.tree.Panel of ExtJS 4.2.1. I would like to know if there is a way to preserve the position of the scrollbar after a data load (i.e. setRootNode(), loadData()). Right now, after the data is loaded, the scrollbar position is reset to the top.
Thanks in advance for any lead on this.
Try following code.
viewConfig: {
preserveScrollOnReload: true
}
I know this is old, but I noticed that "preserveScrollOnReload" does not work in Ext.tree.panel.
I resolved with cacheScrollValues. Example:
function updateNodes(nodes) {
var restoreScroll = App.yourGrid.el.cacheScrollValues();
var sto = App.yourGrid.getStore();
sto.setRootNode(nodes);
restoreScroll();
PS: I'm also using ext 4.2.1.
Hi try adding the following code once to your tree panel for scroll preserving.
For more information on this here from Sencha docs
viewConfig: {
preserveScrollOnRefresh: true
}
Hope it helps you.
I'm using Sencha Touch 2 and wonder how I listen to the Store's refresh event in my Ext.dataview.List? I want that my list automatically updates when there are new records in my store, so the refresh event seems to do the job for me, but how do I set up a listener?
Edit: Thanks to Anand Gupta I realized my problem isn't refreshing the list but just displaying it. So I will give you some more information and hope you can help me. I use NavigationView inside tabpanel. I have one list loading from localstorage which works just fine, if you tap disclose indicator you come to a form with a button "auto complete".
By tapping autocomplete the following method is called:
e.stopEvent();
var lastname = this.getNewUserForm().down("textfield[name=lastname]").getValue();
if(lastname!=="")
{
var complete = this.getApplication().getController("Complete");
this.getUserNav().push(complete.getView());
complete.setSearch(this.getNewUserForm().down("textfield[name=firstname]").getValue(), lastname);
}
else
{
//errormessage
}
The getView() method is a ref with auto create and the "setSearch" Message on Complete Controller simply loads the Store through jsonP Proxy:
var store = Ext.getStore("Playernames");
store.setParams({firstname:firstname, lastname:lastname});
store.load({callback: function(){
console.log(this);
}});
I added a log to see that the store is properly loaded and store is properly loaded.
Thanks for help
Ok after some more hard search I found my bug: I had a List view embedded in a Panel with an undefined layout. So I changed the layout to "fit" and it works fine.
I have a data store and a grid. I add filters in the store and they work properly as I see the results in my grid. But once I disable all my filters aka clear them from my store I want to view all my rows in the grid without reloading them from a web service which is a kind of heavy task. All data is already fetched from the service and there is no need to reaload it again.
How can I do this? Is there some function in the store?
There already was a similar question with correct answer. In short, you need to call filter method without params after setting remoteFilter to false:
store.remoteFilter = false;
store.clearFilter();
store.remoteFilter = true;
store.filter();
Here is a jsfiddle: http://jsfiddle.net/8Gmtd/
I suspect that your grid's view is not refreshed. Try this:
mygrid.getView().refresh()