jQWidgets Forums

jQuery UI Widgets Forums Grid Grid Filterrow

This topic contains 4 replies, has 2 voices, and was last updated by  simcon94 11 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Grid Filterrow #54641

    simcon94
    Participant

    Hi,
    i have problems with the FilterRow. This is my Grid:

    
    // Get Source
            var source = {
                datatype: "json"
                , async: false
                , datafields: []
                , url: "../getData"
            }; 
            
            // set Data Adapter
            var dataAdapter = new $.jqx.dataAdapter(source, {
                loadError: function (xhr, status, error) { alert('Error loading "' + source.url + '" : ' + error); }
            });
    
    $("#grid").jqxGrid(
                {
                    width: 500
                    , source: dataAdapter
                    , columnsresize: true
                    , keyboardnavigation: true
                    , groupable: true
                    , sortable: true
                    , filterable: true
                    , showfilterrow: true
                    ,columns: @Html.Raw(ExpandoObjectExtensions.ToJson(Model.ResultTable, true))
                }
    

    This Grid is loading dynamic. getData gives a json back:
    1.{text: “Datum”, datafield: “Datum”, cellclassname: cellsSum, align: ‘center’, width:”100″ , filtertype: ‘textbox’, filtercondition: ‘CONTAINS’}
    2.{text: “Nummer”, datafield: “Nummer”, cellclassname: cellsSum, align: ‘center’, width:”100″ , filtertype: ‘textbox’, filtercondition: ‘CONTAINS’}

    with hte Json 1 the filter is working correct.
    But with Json 2 the Filetr doesn’t work……

    Any Idea?

    Grid Filterrow #54642

    simcon94
    Participant

    I found the problem.
    The Values in Json 2 in Cell Nr is
    0002
    9003
    and so on. This Value he can parse to an date.
    Thats the reason….
    So the next problem is, that the datafields: [] must be dynamic.
    How can i do that?

    Grid Filterrow #54644

    simcon94
    Participant

    This happen is jqxgrid.filter.js in row :1190
    var tmpvalue = new Date(cell);

    Cell Value =”0002″ -> Date {Tue Jan 01 0002 01:00:00 GMT+0100}

    Grid Filterrow #54651

    Peter Stoev
    Keymaster

    Hi simcon94,

    datafields should be initialized in order to use jqxGrid and bind it to some data source. Also each datafield should have the “name” and “type” members set to appropriate values corresponding to the data bound field’s name and its type which could be “string”, “number”, “bool” or “date”. You should either load them before binding the widget, or implement the beforeLoadComplete or downloadComplete(in case of binding through Ajax) function of jqxDataAdapter and dynamically set the datafields property.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Grid Filterrow #54669

    simcon94
    Participant

    Do you have an example?

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

You must be logged in to reply to this topic.