1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    35
    Vote Rating
    0
    marklar is on a distinguished road

      0  

    Default Paging Grid with XML Bug - Bug Fix Provided

    Paging Grid with XML Bug - Bug Fix Provided


    I was trying to get the Paging working with XML and could not get it working.

    Summary: I had to update the following code in the base to fix the issue.

    Side Note
    I have only been using this API since Thursday, so I am very new. So if I am way off base please accept my appologies in advance and let me know how to fix this without an update to the base code.

    Great stuff and I look forward to much contribution.

    The Issue:
    Paging was only showing total for the page, not grand total when using XML output.

    The Fix:
    A minor two word update in the readRecords function of Ext.data.XmlReader fixed the issue.

    Original Code
    Extra code included to show context of the update.

    Code:
    Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
        read : function(response){
            var doc = response.responseXML;
            if(!doc) {
                throw {message: "XmlReader.read: XML Document not available"};
            }
            return this.readRecords(doc);
        },
        
        readRecords : function(doc){
            this.xmlData = doc;
            var root = doc.documentElement || doc;
        	var q = Ext.DomQuery;
        	var recordType = this.recordType, fields = recordType.prototype.fields;
        	var sid = this.meta.id;
        	var totalRecords = 0;
        	if(this.meta.totalRecords){
        	    totalRecords = q.selectNumber(this.meta.totalRecords, root, 0);
        	}
    Updated Code
    Note: Changed totalRecords to totalProperty at the very bottom of the code - shown below:
    Code:
        	if(this.meta.totalProperty){
        	    totalRecords = q.selectNumber(this.meta.totalProperty, root, 0);
        	}
    Other Notes:
    I had to also figure out to accept the start and limit parameters in my agent that were being appended .. only when setting the method to GET.

    So if anyone is having issues with parameters not working, try using method: GET along with url.
    If anyone is having issues with too many being returned, assure the process getting the parameters knows is returning the proper number based on start and limit query_string params.

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Actually, this is not a bug that is the config value name. "totalProperty" makes sense on json data (where it is used) because you are wroking with objects but doesn't make a lot of sense for XML. So it has the name "totalRecords".

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    35
    Vote Rating
    0
    marklar is on a distinguished road

      0  

    Default I see use totalRecords: x - thanks so much for the reply

    I see use totalRecords: x - thanks so much for the reply


    I replaced old files - updated my code
    Code:
      totalRecords: 'TotalResults',
    works fine.

    I am so new - thanks for taking the time to clear that up.

    You are THE MAN! So impressed :!:

Similar Threads

  1. Paging Grid...
    By fredstra in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 7 Mar 2007, 7:55 AM
  2. regarding paging grid
    By noname in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 1 Mar 2007, 4:54 AM
  3. XHR Grid Paging
    By Ramsay in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 27 Feb 2007, 7:57 PM
  4. Does Grid.autoSize factor in paging toolbar for paged grid?
    By davida in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 28 Dec 2006, 9:47 AM
  5. Grid not paging
    By dshieh in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 12 Dec 2006, 9:12 AM

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