jQWidgets Forums

jQuery UI Widgets Forums Grid lost list's filter when filter other column

This topic contains 9 replies, has 2 voices, and was last updated by  payamjalili 8 years, 1 month ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author

  • payamjalili
    Participant

    hi
    i have a grid with server side paging,sorting and filtering
    this is my Grid preview: https://www.jseditor.io/?key=lost-list-filter-whene-filter-other-column-in-serverside-filtering

    i have a list filtertype in column(s) and have problem with filtertype list

    1- list source send multiply request to server at grid ready
    2- list source send request to server in evry filtering and paging but i dont want send request to server in paging because server returned json data at first time and json don’t change in filtering or paging
    3- My main problem is when filter grid with dropdownlist, grid update data and working good but when filter other column, the list filter is automaticly lost!!!!! and i don’t know why filter in column with filtertype:list was lost

    please help me.
    tnx


    Hristo
    Participant

    Hello payamjalili,

    When you implement ‘filter’, ‘sort’ and ‘pager’ callbacks in the DataAdapter’s source they will be called each time when the relevant functionality is called.
    There using updatebounddata method and this makes server calls.
    You could load data from the server as JSON data like in this demo:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/bindingtojson.htm?light

    About your last question could you provide us simple example that demonstrates this issue (your example is huge and there is no data to make tests)?

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com


    payamjalili
    Participant

    Hello Hristo,

    Thank you for answering and sorry about my bad english 😉

    I think when call updatebounddata grid rebuild list filter and lost selectedindex in dropdown list filter.

    My Server response for each filter and grid data is JSON object

    Response of Filter List is:

    [
      {
        "CatalogValueID": "324e802c-f67d-4ffa-a01a-afffe7c12d71",
        "Title": "مرکزی",
        "CatalogOrder": 1,
        "CatalogValueCode": "WarehouseType",
        "ParentID": "8b3f5df4-ce7d-41ec-9b07-8f13f595d1a6",
        "TextField": "مرکزی",
        "ValueField": 1,
        "GoodShippingGroupID": 1
      },
      {
        "CatalogValueID": "0e931a97-602a-4c69-a816-28031c018be0",
        "Title": "توزیع",
        "CatalogOrder": 2,
        "CatalogValueCode": "WarehouseType",
        "ParentID": "8b3f5df4-ce7d-41ec-9b07-8f13f595d1a6",
        "TextField": "توزیع",
        "ValueField": 2,
        "GoodShippingGroupID": 2
      }
    ]

    Little Response of Grid Data is:

    {
      "total": 810,
      "rows": [
        {
          "WarehouseID": "a013d128-1b6b-484c-b32b-a3b723392dbc",
          "WarehouseTypeID": 2,
          "WarehouseName": "لیان2",
          "WarehouseCode": "365250",
          "FullName": "فروشگاه چارسو",
          "ProvinceTitle": "قم",
          "CityTitle": "سلفچگان",
          "WarehouseTel": null,
          "IsActive": true,
          "WarehouseAddress": "قم",
          "Description": null,
          "RegionCodeID": null,
          "CodeNumber": null,
          "RegionName": null,
          "ProvinceID": "e8333a84-eb2b-4e53-ad6a-0efbc419dc5c",
          "CityID": "06481194-eec2-4d1d-ab3f-29a14cf32379",
          "PostalCode": null,
          "GLCWarehouse": true,
          "Fax": null,
          "PersonID": "46875c84-84f0-4289-bb8a-a2da435c340d",
          "WarehouseTypeID_Title": "توزیع"
        },
        {
          "WarehouseID": "e2d73335-8bff-42c5-ba6a-a5fd8497e08e",
          "WarehouseTypeID": 1,
          "WarehouseName": "یزدان پناه",
          "WarehouseCode": "2555",
          "FullName": null,
          "ProvinceTitle": "خوزستان",
          "CityTitle": "آبادان",
          "WarehouseTel": "542585",
          "IsActive": true,
          "WarehouseAddress": "خوزستان - آبادان",
          "Description": null,
          "RegionCodeID": "8dab5652-cd38-46c3-9fd2-26ed2fa77da6",
          "CodeNumber": "1012",
          "RegionName": "(لواسانات)1",
          "ProvinceID": "b7bd9fcd-4b48-4fca-a245-4c09de3aaf38",
          "CityID": "5efd9f81-e90b-47ad-a680-1797ba294ff0",
          "PostalCode": null,
          "GLCWarehouse": true,
          "Fax": "25685",
          "PersonID": null,
          "WarehouseTypeID_Title": "مرکزی"
        }]
    }

    For security reason i can’t publish online demo but i can send screenshot

    this is normal grid:

    then filter list column and working good

    then filter other column and you can see list filter has lost

    I try to cells in updatebounddata method like this in my source but some time list filter has lost and some time filtering without losting list filter

    filter: function () {
        grid.jqxGrid('updatebounddata', 'cells');
    }

    Hristo
    Participant

    Hello payamjalili,

    If you want to update the source and want to save filtering case you should use $('#jqxGrid').jqxGrid('updatebounddata', 'filter'); with argument ‘filter’.
    I look at your example and some of the used properties are nonexistent.
    Could you clarify – you mean filter by one column and when you want to filter by another the first one lost its filtering?
    I would like to suggest you this tutorial, it could be helpful and if you want to create own filtering case, too:
    https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-filtering.htm

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com


    payamjalili
    Participant

    Hello Hristo Hristov,

    Thanks for the follow-up and accountability

    Problem from this code:

    $('#jqgrid').bind('bindingcomplete', function (event) {
        // apply localization.
        grid.jqxGrid('localizestrings', localizationobj);
    });

    when using localizestrings method, grid’s filter has been conflict. ( When i comment this method filtering work perfect but when i uncomment this filtering work with problem )

    Translation operator in the filtering interfere.

    This is my translation object: https://www.jseditor.io/?key=localization-conflict-in-filtering

    filterstringcomparisonoperators and filterchoosestring has been conflict.

    tanx


    payamjalili
    Participant

    I solved my problem

    use localizestrings method in ready function and translation applied

    when i use localizestrings method in bindingcomplete event multiple initial filter list and old filter has been lost.


    Hristo
    Participant

    Hello payamjalili,

    Thank you for sharing your knowledge with the community.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com


    payamjalili
    Participant

    Hello Hristo Hristov,

    Your Welcome

    The second part of my problem remains. http://www.jqwidgets.com/community/topic/lost-lists-filter-when-filter-other-column/#post-93564

    when use localizestrings list dropdown initial again and post second request and filter operation like filterstringcomparisonoperators and filterchoosestring has been conflict.


    Hristo
    Participant

    Hello payamjalili,

    Could you share set option Share -> “Everyone” and save again your example (“https://www.jseditor.io/?key=localization-conflict-in-filtering”)?
    I would suggest you set this localization object with localizestrings method immediately after the Grid’s initialization without including in events just a simple row.
    Also, you could set it to ‘localization’ property as in this example.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com


    payamjalili
    Participant

    Hello Hristo Hristov, thank you for your reply.

    Thanks for your attention, My Problem solved by using localization Property.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.