Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: PagingToolBar Question for the experts

  1. #1
    Ext User
    Join Date
    May 2007
    Posts
    69

    Exclamation PagingToolBar Question for the experts

    Hi all!

    i noticed that the paging toolbar only sends the limit and start through a post. Has anyone been able to master sending additional information such as the id number for the last row in the grid? (the id being the unique value mapped to the reader)

  2. #2
    Sencha User
    Join Date
    Jul 2007
    Posts
    14

    Default

    I too have a similar use case. Not able to find a straight way.

    I Just Extended the PagingToolBar and overwritten the onClick : function(which) function.

  3. #3
    Ext User matjaz's Avatar
    Join Date
    Apr 2007
    Location
    Slovenia
    Posts
    126

  4. #4
    Sencha User
    Join Date
    Jul 2007
    Posts
    14

    Default

    Well the lastRow Id will be known only after loading the data. And also do we wont have a control when the next, previous buttons are clicked. So how can we pass the parameter in the baseParams ??

  5. #5
    Sencha Developer
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    482

    Default

    Hello,
    This has been covered so many times, please check the examples section.
    Here an excerpt that might help you:
    PHP Code:
            // eventhandle: modify the baseParams setting for this request
            
    ds.on('beforeload', function() {
                
    ds.baseParams = {
                    
    'cdrType'cdrType,
                    
    'fromDate'fromDate.getValue(),
                    
    'toDate'toDate.getValue(),
                    
    'number'filter.getValue()
                };
            }); 

  6. #6
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    @mfw24: https://www.sencha.com/forum/showthread.php?t=4290 (i think)

    p.s. @wolfgang, pls correct me if i'm wrong

  7. #7
    Ext User
    Join Date
    May 2007
    Posts
    69

    Default

    that helped sooo much!

    thank you both!

  8. #8
    Sencha Developer
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    482

    Default

    @mystix
    @wolfgang, pls correct me if i'm wrong
    The link was fine. Thanks.

    Wolfgang

  9. #9
    Ext JS Premium Member catnipper's Avatar
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    22

    Default set filter: Ok - remove filter: ?

    First of all: thank's for the Framework and thank's to the people keeping the forum alive!

    Having some background with XML, XSLT and CMS - I just started using frameworks to benefit from all the existing modules and functions.
    Being a new user of ext , I was until now able to follow the basic examples on the 'doc' section. But right now - I'm getting in trouble doing some modifications on them ;-)

    There are two problems I was not able to solve so far by searching on both - forum and documentation:
    1. After applying the (server-) filter, I'm not able to remove/reset it.
    2. ds.load(...) does not refresh the FooterPanel.


    I'm using a standard grid with an additional toolbar that's being created by the following code:
    PHP Code:
    ...
       
    /************************************************************
        * create header panel 
        * add filter field - search function
        ************************************************************/
        
    var gridHead grid.getView().getHeaderPanel(true);
        var 
    tb = new Ext.Toolbar(gridHead);
         
         
        
    // Create the filter field
        
    var FullText Ext.get(tb.addDom({ // add a DomHelper config to the toolbar and return a reference to it
             
    tag'input'
             
    type'text'
             
    value'Enter your search term here'
             
    style'background: #F0F0F9;width:200px;color:#5c5c5c;margin-left:2px;margin-right:5px;'
        
    }).el);
     
        
    // press enter keyboard
        
    FullText.on('keypress', function(e) { // setup an onkeypress event handler
          
    if(e.getKey() == e.ENTER && this.getValue().length && this.getValue() != 'Enter your search term here') {// listen for the ENTER key
              
    ds.load({params:{start:0limit:25}});
          }
        });
        
        var 
    RemoveFilter tb.add({
                
    text'Remove Filter',
                
    handleronRemoveFilter,
                
    cls'x-btn-text-icon btn-warning'
            
    });
            
        function 
    onRemoveFilter(){
            
    ds.load({params:{start:0limit:25}});
        }
        
        
    /************************************************** **********
        * load parameter to backend
        * have beforeload function
        ************************************************** **********/
        
    ds.on('beforeload', function() {
            
    ds.baseParams = {
                
    FullTextFullText.getValue(),
            };
        });
    ... 
    Thank's in advance for any solutions, hints and explanations!

  10. #10
    Ext Premium Member BernardChhun's Avatar
    Join Date
    Mar 2007
    Location
    Quebec, Canada
    Posts
    831

    Default

    Hey catnipper,

    removing the filter is easy but you got some server side things to do. Does your DataStore sends an empty FullText value to your server-side when there's nothing in the input field? if it is so, why can't ya just return the full data in those cases?

    I have made a filter as well in my grid and I send a null value when the user removes the filter value. I just check out its value on the server side and act accordingly.

    oh and what do you mean by "ds.load(...) does not refresh the FooterPanel."? whats in your footer panel?I assume it's a paging toolbar. so is your DS linked appropriately to the paging toolbar?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •