Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

Hybrid View

  1. #1
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,406
    Vote Rating
    6
    stever will become famous soon enough stever will become famous soon enough

      0  

    Default Ext.Direct for Grids -- what about filter and sort?

    Ext.Direct for Grids -- what about filter and sort?


    I tried using ExtJS4 Direct with a Grid, which works fine. However, I don't see or understand how filters and sorts get passed like they do with an "ajax" proxy. The "direct" proxy seems to ignore these very important aspects of dealing with grids. Any insight as to where I am going wrong?

  2. #2
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    65
    Vote Rating
    2
    ralscha is on a distinguished road

      1  

    Default


    Not sure what you are doing wrong, but sorting and filtering works fine for me.

    Make sure that you specify the "remoteSort: true" property on the store.
    Here's a demo for sorting.
    Grid with Sort
    and here a json request the store sends:
    Code:
    {
        "action": "person4Action",
        "method": "loadWithPaging",
        "data": [
            {
                "page": 1,
                "start": 0,
                "limit": 50,
                "sort": [
                    {
                        "property": "lastName",
                        "direction": "ASC"
                    }
                ]
            }
        ],
        "type": "rpc",
        "tid": 7
    }

    Here an example for filtering
    Grid with Filter

    and the json request
    Code:
    {
        "action": "filterAction",
        "method": "load",
        "data": [
            {
                "filter": "[{\"type\":\"numeric\",\"comparison\":\"lt\",\"value\":10,\"field\":\"id\"}]",
                "page": 1,
                "start": 0,
                "limit": 50
            }
        ],
        "type": "rpc",
        "tid": 2
    }
    Ralph

  3. #3
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,406
    Vote Rating
    6
    stever will become famous soon enough stever will become famous soon enough

      0  

    Default


    Thanks! I forgot the signatures. For example, read() is really read($data). I have to go back and lookup what the signatures are for the others...

  4. #4
    Ext Premium Member
    Join Date
    Aug 2008
    Location
    San Rafael, CA
    Posts
    31
    Vote Rating
    0
    JGALFO is on a distinguished road

      0  

    Default


    I was having a similar issue with Direct and Ext 4.0.7 which was puzzling and it seems to me like it might be a bug.

    I am using ColdFusion and my in this particular example, the createAPIScript function (ExtDirect.cfc) was returning a the following definition:

    Code:
    Ext.app.REMOTING_API = {
            "url":"/_mhw/ics/handlers/Router.cfm"
           ,"type":"remoting"
           ,"actions":{ "authenticateService": [
                    {"len":2,"name":"handlelogin"}
                   ,{"len":2,"name":"getUserList"}
                   ,{"len":0,"name":"keepAlive"}
                   ,{"len":0,"name":"logout"}
               ]
            }
    };
    Notice that getUserList has 2 params on the server side and ExtDirect.cfc specified the len attribute to that.

    Now, if I setup a proxy (without paramOrder) to execute that action, and put that in a store to be used in a grid, the grid never populates (see ScreenShot1) Notice that Direct passed 2 arguments, one object and a null value. The backend did return a valid json with my records but the grid did not populate.

    Code:
    proxy : {
             type : 'direct'
            ,directFn : authenticateService.getUserList
            //,paramsAsHash: true
            //,paramOrder: ['username','password']
            ,extraParams: {
                  username: 'jgalfo'
             }     
            ,reader: {
                 type: 'json'
                ,root: 'data'
                ,totalProperty  : 'recordcount'             
            }
        }
    ScreenShot1.jpg
    Now if I hardcode the len attribute in my definition to 1, it will work fine because Direct will send only one param with an object which my Router will in turn send to the backend in the form of params.

    Also, while researching I found this http://www.sencha.com/forum/showthre...l=1#post617480 which suggests adding a parameter array in the definition instead of the len attribute but when I tried that the sorting and filtering was not being passed to the request.

    Any sencha guys that can shed some light into this?

    Thanks.

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    1
    Vote Rating
    0
    EC_Johnson2000 is on a distinguished road

      0  

    Default


    I'm having a very similar issue! Has anyone here has any success?

    I'm also seeing a behavior where 'Direct' proxy I'm using on my grid's store is adding a function to the data arguments. This then in turn is causing the data to cause a stack overflow when the AJAX classes attempt to un-marshal the data to JSON in it's 'setOptions' method. It seems the direct proxy is very explicit in adding the extra variables to the data array in it's 'doRequest' method. After a day, I haven't been able to deduce where this gets used by EXT and how it could possibly not break the request process

    I'm a big Ext fan, and I've used Grids and Direct successfully by themselves. I'd love to combine the two. The article at http://docs.sencha.com/ext-js/4-0/#!...irect_grid_pt1 sure makes it sound easy, but it hasn't been!

    I fear I've missed a config option on the grid, store, proxy or all three Here is the config if it helps. I'm happy to provide more info and will continue to investigate

    Ext.create('Ext.grid.Panel', {
    store : {
    model : 'PersonalInfo',
    autoLoad : true,
    proxy : {
    type : 'direct',
    api : {
    read : actions.multy
    }
    }
    },
    columns : [ {
    dataIndex : 'id',
    width : 50,
    text : 'ID'
    }, {
    dataIndex : 'name',
    flex : 1,
    text : 'Name'
    }, {
    dataIndex : 'address',
    flex : 1.3,
    text : 'Address'
    }, {
    dataIndex : 'state',
    flex : 1,
    text : 'State'
    } ],
    height : 450,
    width : 700,
    title : 'Velociraptor Owners',
    renderTo : Ext.getBody()
    });

  6. #6
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    354
    Vote Rating
    5
    stewardsencha is on a distinguished road

      0  

    Default


    The answer shows a grid filter. Which buries the actual logic of setting a filter on a store for somewhere in the filters features.

    I've been trolling a while and still haven't come up with a simpler example.

    When I trace it through I get lost in the logic.

    I have a store vm, and I want to filter by cat_id.

    Code:
            this.VMCatFilter=Ext.create('Ext.util.Filter',{
                property: 'cat_id',
                value   : 3
            });
            vm.filter([this.VMCatFilter])
            vm.load({
                params:{start:0, limit:12
                },
                callback: function(result, options, success) {
                    if (!success) {
                        alert('VideoControl.vm.load fail');
                    }
                }
            });
    Finally I find the right syntax to get the request to the server. But somehow along the way it has put the filters in twice...

    Code:
    stdClass Object
    (
        [sort] => Most fooed
        [page] => 1
        [start] => 0
        [limit] => 25
        [filter] => Array
            (
                [0] => stdClass Object
                    (
                        [property] => cat_id
                        [value] => 3
                    )
    
            )
    
        [dir] => 
        [filters] => Array
            (
                [0] => stdClass Object
                    (
                        [property] => cat_id
                        [value] => 3
                    )
    
            )
    
    )
    I get the same result with

    Code:
            vm.filter('cat_id',3)