Results 1 to 10 of 10

Thread: [3.0RC1]pagingToolBar and zero

  1. #1
    Sencha User TopKatz's Avatar
    Join Date
    Mar 2007
    Posts
    340

    Default [3.0RC1]pagingToolBar and zero

    This is probably a bug, but figured I would start here.

    Starting to plow through getting 3.0 running and all of my paging grids are not working. It looks like zero "0" is getting striped out for some reason. It has been manifesting it self with the start param, however it effects limit as well.

    If I change start to 1 it works, and if I change limit to 0 it send blank.

    EDIT - it looks to be all 'GET' requests. That any param that is an int = 0 is evaled to blank.

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Katz,

    Confirmed. I know its a behavior change, not too sure if i would consider it a bug.

    For others to see this, load: http://extjs.com/deploy/ext-3.0-rc1/...id/paging.html and look the post parameters for topic-browse-remote.php

  3. #3
    Sencha User TopKatz's Avatar
    Join Date
    Mar 2007
    Posts
    340

    Default

    Jay - this is looking like all Ext.Ajax.request get is converting a param of int 0 to blank. Is this really not a bug?

    Do I need to handle this on the server side now? That sounds like bad practice to assume that blank = 0 on the back end.

    EDIT - run this in FB :


    Ext.Ajax.request({ url: '/blank', params: { foo: 0 }, method: 'GET' })

    then inspect the params. foo = blank.

  4. #4
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    agreed. I didn't look at it, wasn't too sure where the problem is. I would say that it is a bug.
    test case:
    Code:
    Ext.Ajax.request({
        url : 'index.html',
        params : {
            paramZero : 0,
            paramOne  : 1
        }
    });

  5. #5

  6. #6
    Sencha User mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061

    Default

    I posted about this in another thread. The bug is actually in Ext.urlEncode. This code seems to fix the problem:

    Code:
    Ext.apply(Ext, {
        urlEncode: function(o, pre) {
            var buf = [],
            key,
            e = encodeURIComponent;
    
            for (key in o) {
                Ext.each((o[key] !== undefined) ? o[key] : key,
                function(val, i) {
                    buf.push("&", e(key), "=", val != key ? e(val) : "");
                });
            }
            if (!pre) {
                buf.shift();
                pre = "";
            }
            return pre + buf.join('');
        }
    });

  7. #7
    Sencha User TopKatz's Avatar
    Join Date
    Mar 2007
    Posts
    340

    Default

    Quote Originally Posted by [email protected] View Post
    good find btw!
    I cant take the credit. It was a combined effort by Mitz` and I in irc.

  8. #8
    Sencha User TopKatz's Avatar
    Join Date
    Mar 2007
    Posts
    340

    Default

    Quote Originally Posted by mschwartz View Post
    I posted about this in another thread. The bug is actually in Ext.urlEncode. This code seems to fix the problem:

    Code:
    Ext.apply(Ext, {
        urlEncode: function(o, pre) {
            var buf = [],
            key,
            e = encodeURIComponent;
    
            for (key in o) {
                Ext.each((o[key] !== undefined) ? o[key] : key,
                function(val, i) {
                    buf.push("&", e(key), "=", val != key ? e(val) : "");
                });
            }
            if (!pre) {
                buf.shift();
                pre = "";
            }
            return pre + buf.join('');
        }
    });

    This does the trick for me. Thanks

  9. #9
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    I would move this thread, but I'm not an admin

    Either way, i'm hoping a senior Ext developer will see this here.

    Great work guys. thanks for taking the time to provide the feedback.

  10. #10
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    No need, it's already reported.

Posting Permissions

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