[CLOSED] Remote ListFilter (gridFilter)

  1. #1

    [CLOSED] Remote ListFilter (gridFilter)

    Hi,

    I'm trying to have my grid remotely filter using a simple listFilter.. this works fine in getting to the server-side with a gridfilter string. The problem is that rather than using the ID value of the item chosen from the list, it's using the LabelField value.. which isn't going to map up correctly in my code.

    eg:

      <ext:ListFilter DataIndex="AdviceTypeId" StoreID="storeAdviceTypes" LabelField="Title" />
    .. will give me a nice list of values on the filter, but the value it's passing back is not the Id column. I guess it doesn't know about this (like a combo-box would with DisplayField/ValueField).

    eg, this is what the gridfilter string looks like:

    "{\"f_0_field\":\"AdviceTypeId\",\"f_0_data_type\":\"list\",\"f_0_data_value\":[\"Pension\"]}"
    Notice that the value, is text rather than the Id integer I would like associated with that value. Is there a way to change this behavior?

    Thanks.
    Last edited by Daniil; Mar 29, 2012 at 10:45 PM. Reason: [CLOSED]
  2. #2
    Hi,

    How is the storeAdviceTypes configured?

    There must be the RecordField with
    Name="id"
    which you'd like to be sent to a server.
    Last edited by Daniil; Mar 23, 2012 at 5:40 PM.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    How is the storeAdviceTypes configured?

    There must be the RecordField with
    Name=id"
    which you'd like to be sent to a server.
        <ext:Store ID="storeAdviceTypes" runat="server" ShowWarningOnFailure="true">
            <Reader>
                <ext:JsonReader IDProperty="Id">
                    <Fields>
                        <ext:RecordField Name="Id" />
                        <ext:RecordField Name="Title" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
  4. #4
    Please set up to "id". The lower-case first letter.
  5. #5
    Quote Originally Posted by Daniil View Post
    Please set up to "id". The lower-case first letter.
    EDIT: I've made an error in my code, sorry. You will be correct, I'm sure. I'll change the code. Sorry for the misunderstanding.
  6. #6
    Quote Originally Posted by peter.campbell View Post
    EDIT: I've made an error in my code, sorry. You will be correct, I'm sure. I'll change the code. Sorry for the misunderstanding.
    Sorry. I've changed the code and it still doesnt work. My code:

     <ext:Column Header="Type" DataIndex="ActionTypeId">
                                <Renderer Fn="actionTypeRenderer" />
                            </ext:Column>
    This renders the number into the text description.

     <ext:ListFilter DataIndex="ActionTypeId" StoreID="storeActionType" LabelField="ActionDescription" />
    This is my gridfilter plugin specification.

        <ext:Store ID="storeActionType" runat="server" ShowWarningOnFailure="true">
            <Reader>
                <ext:JsonReader IDProperty="id">
                    <Fields>
                        <ext:RecordField Name="id" />
                        <ext:RecordField Name="ActionDescription" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    This is my store of values for the ActionType, which I am using to bind to the gridfilter so provide the list of values, and the rendered text. When I filter on this column it continues to return only the LabelField value (text description) rather than the id.
  7. #7
    Confirmed. My suggestion was for Ext.NET v2.

    Please set up your custom GetValue for the ListFilter. It might be just:
    <GetValue Handler="return this.menu.selected;" />
  8. #8
    Quote Originally Posted by Daniil View Post
    Confirmed. My suggestion was for Ext.NET v2.

    Please set up your custom GetValue for the ListFilter. It might be just:
    <GetValue Handler="return this.menu.selected;" />
    Thanks Daniil. I've now fixed my code using your suggestion and this works. Thank you. Is this behaviour different in Ext.NET v2?
  9. #9
    Is this behaviour different in Ext.NET v2?
    In v2 setting a ModelField with Name="id" is enough.

    Here is the related thread:
    http://forums.ext.net/showthread.php?17952

Similar Threads

  1. [CLOSED] ListFilter problem
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 12, 2012, 12:51 PM
  2. [CLOSED] ListFilter values
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 23, 2012, 3:41 PM
  3. [CLOSED] GridFilter Remote ComboBox filter
    By kenanhancer in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 17, 2011, 3:20 PM
  4. [CLOSED] Remote GridFilter is not removed
    By macap in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Jun 01, 2011, 3:43 PM
  5. [CLOSED] gridfilter remote question
    By vali1993 in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 24, 2011, 4:14 PM

Tags for this Thread

Posting Permissions