1. #1
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    19
    Vote Rating
    0
    Suresh is on a distinguished road

      0  

    Default Pagination problem with ComboBox in local mode

    Pagination problem with ComboBox in local mode


    Hi,

    I have problem with combo box pagination in local mode. I am using SimplePagingStore as a store to the combo box.

    Problem : when combo box drop down trigger, the pagination tool bar showing as total pages are 1 even there are n number of pages and the next button is disabled.

    When refresh the paging tool bar, the pagination works properly, it shows total number of pages and next buttons enabled.

    Here is the code:

    Code:
    Ext.onReady(function(){
    
    	var dataArr = [];
    	for(i=1;i<=20;i++){
      		dataArr.push([i, 'Agent'+i]);
    	}
    
      	var dataStore = new Ext.ux.data.SimplePagingStore({
    	  	fields: ['id', 'name'],
      	  	data: dataArr
      	});
    
    
    	var mycombo = new Ext.form.ComboBox({
    		 id:'mycmb'
    		,renderTo:'combo1'
    		,width:200
    		,hideOnSelect:false
    		,maxHeight:200
    		,store:dataStore
    		,triggerAction:'all'
    		,valueField:'id'
    		,displayField:'name'
    		,mode:'local'
    		,pageSize:5
    	});
    
    	dataStore.load({params: {start: 0, limit: 5}});
    
    });
    Can anyone please point what is wrong in this.

    Thanks,
    Suresh

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    With local data you need to specify lastOptions (see PagingStore thread).

  3. #3
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    19
    Vote Rating
    0
    Suresh is on a distinguished road

      0  

    Default


    I have verified with that option as well, but no luck.

    Code:
           var dataStore = new Ext.ux.data.SimplePagingStore({
    	  	fields: ['id', 'name'],
      	  	data: dataArr,
      	  	lastOptions: {params: {start: 0, limit: 5}}
      	});

  4. #4
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    19
    Vote Rating
    0
    Suresh is on a distinguished road

      0  

    Default


    I am using 2.x Ext.ux.data.PagingStore [v0.4].

  5. #5
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    19
    Vote Rating
    0
    Suresh is on a distinguished road

      0  

    Default


    Here I am attaching the image, this explains my problem.

    [IMG]C:\Documents and Settings\suresh\Desktop\dropdown.JPG[/IMG]


    I am sure, I am doing some thing wrong, please correct me.

    Thanks,
    Suresh

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    I tested ext-3.2.0 and your combobox displays correctly.

    Which Ext version are you using?

    ps. You don't need to load the store if you specify 'data'.
    Code:
    dataStore.load({params: {start: 0, limit: 5}});

  7. #7
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    19
    Vote Rating
    0
    Suresh is on a distinguished road

      0  

    Default


    Thanks for the reply Condor.
    I am using ext-2.0.2 because this is LGPL.

  8. #8
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    I'll have to check ext-2.0.2...

    ps. Aren't you bothered by the fact that ext-2.0.2 doesn't correctly support IE8, Firefox3 and Safari4?

  9. #9
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    19
    Vote Rating
    0
    Suresh is on a distinguished road

      0  

    Default


    Solved it by adding lazyInit:false. On page load the pagination works.

    Code:
    Ext.onReady(function(){
    
    	dataArr = [];
    	for(i=1;i<=20;i++){
      		dataArr.push([i, 'Agent'+i]);
    	}
    
      	dataStore = new Ext.ux.data.SimplePagingStore({
    	  	fields: ['id', 'name'],
      	  	data: dataArr,
      	  	lastOptions: {params: {start: 0, limit: 5}}
      	});
    
    	mycombo = new Ext.form.ComboBox({
    		 id:'mycmb'
    		,renderTo:'combo1'
    		,width:200
    		,hideOnSelect:false
    		,maxHeight:200
    		,store:dataStore
    		,triggerAction:'all'
    		,valueField:'id'
    		,displayField:'name'
    		,mode:'local'
    		,pageSize:5
    		,resizable: true
    		,lazyInit:false
    	});
    	dataStore.load({params: {start: 0, limit: 5}});
    });
    We are using extjs in very limited places of my project. I will push for upgrading to ext-3.2.

    Thanks Condor for your help.

    Thanks,
    Suresh

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar