Modify store load params clientside

Page 1 of 2 12 LastLast
  1. #1

    Modify store load params clientside

    How can I modify or add existing parameters to a store during a reload call on the clientside? I dont want to replace all the params. Just modify value of existing or add a new parameter.
  2. #2

    RE: Modify store load params clientside

    The following code will add a new parameter but will not override an existing parameter. Am I doing something wrong?

    grid.reload({params:{new:'0', base:'1'}});
  3. #3

    RE: Modify store load params clientside

    Hi,

    BaseParams are merged with other params (for example which passed by user like in your example) using Ext.applyIf


    applyIf( Object obj, Object config ) : Object
    Copies all the properties of config to obj if they don't already exist.



    It is a reason why your params don't override BaseParams value. The reason why we use 'applyIf' instead 'apply':


    1. For example, you use parameter which retrieve value from TextField: TextField1.getValue()
    2. If you call reload for store then all parameters from previous request will be applied to the current (reload always repeat previous request). So, if we use 'apply' then text field value from previous request overrides current. Therefore we need use 'applyIf' to retrieve correct value


    I can suggest to use function in parameter which will return value. For example:


    <ext:Parameter Name="p1" Value="getMyValue()" Mode="Raw" />
    function getMyValue(){ return Ext.myParamValue;}

    Ext.myParamValue = 'newValue'; grid.reload(); delete Ext.myParamValue;
  4. #4

    RE: Modify store load params clientside

    hi there, im trying to use a function which returns a value as a writebaseparam but it is not working, it is getting the name of the function on the server side and not the value which is supposedly returned by the javascript function
  5. #5

    RE: Modify store load params clientside

    Hi,

    Please show a sample which demonstrates the problem
  6. #6

    RE: Modify store load params clientside

    on my store's WriteBaseParams i have this

    <WriteBaseParams>
            <ext:Parameter Name="GridPanelUnitData" Value="gridRowOrder()" Mode="Raw"  />
        </WriteBaseParams>
    then i have a javascript function

    function getGridOrder()
            {
                Ext.myParamValue = 'newValue'
                return Ext.myParamValue;;
            }
    what im getting on the code behind on the beforestorechanged event is getGridOrder()
  7. #7

    RE: Modify store load params clientside

    i also tried doing this one

    #{extgpIndicators}.save({params:{param1: Ext.encode(#{extgpIndicators}.getRowsValues())}});


    but the problem is i am only getting the modified rows. i need to be able to get all grid row details on the code behind for the beforestorechanged event (when there are changes made) and the refreshdata event (when there is no data change). Please help, thanks
  8. #8

    RE: Modify store load params clientside

    Hi,

    You use different function's names: gridRowOrder and getGridOrder. I tested function as parameter and I got 'newValue' on server-side. Please ensure that you use Mode="Raw". If you can create example which we can test then post it


    You need call getRowsValues(false) to get all rows (without bool params the getRowsValues function returns selected rows only )
  9. #9

    RE: Modify store load params clientside

    ok thanks a lot for the quick reply, i checked the svn code and saw that the getRowsValues have 3 parameters so i just set them all to false to get all the rows in the grid. anyway i got another problem, i just implemented drag and drop on my grid and the problem is for example i got 2 rows in my grid, if i drag my second row up so its now row 1 then call the save function, the second row (which i have just dragged to the first row) is getting marked as Deleted, why is this?
  10. #10

    RE: Modify store load params clientside

    Hi,

    I can't say anything without source code review
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: Jun 26, 2011, 1:59 AM
  2. How to get params when page load
    By huynd in forum 1.x Help
    Replies: 2
    Last Post: Aug 26, 2010, 8:56 AM
  3. [CLOSED] load local file clientside
    By yobnet in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 01, 2010, 3:34 PM
  4. Renderer with link - load params for store
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: Aug 14, 2009, 12:51 PM
  5. [CLOSED] Unable to Load Asp.NET Ajax Framework ClientSide
    By Immobilmente in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 31, 2009, 11:38 AM

Posting Permissions