jQWidgets Forums

jQuery UI Widgets Forums Grid Error while reloading grid

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Error while reloading grid #47643

    Yogesh Singh
    Participant

    Hi i am getting the below error when grid is binding for second time although it displays correctly
    this.colmnheader is null or not an object

    Error while reloading grid #47645

    Peter Stoev
    Keymaster

    Hi Yogesh Singh,

    Could you give a sample which demonstrates this with jQWidgets 3.1.0?

    Best Regards,
    Peter Stoev

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

    Error while reloading grid #47664

    Yogesh Singh
    Participant

    Thanks for quick reply Peter
    Here’s what i am trying to accomplish
    I need to show a pop window based on number records returned by the data adaptar and the function in which i have has adaptar grid and condition to check on the length of the adaptar to open a popup first time it work fine second time it gives me error on the below line in the jqxgrid.js file

    var i=this.columnsheader.find(“#columntable”+this.element.id);
    and once i ignore this error it works fine and it only throws error once when i am reloading a grid for second time

    function lookupSearchResultGrid(source, columns,fieldName) {

    var searchViewGridDataAdapter = new $.jqx.dataAdapter(source);

    $(“#divLookupSearch”).jqxGrid(
    {
    width: ‘100%’,
    source: searchViewGridDataAdapter,
    theme: theme,
    sortable: true,
    pageable: true,
    autoheight: true,
    selectionmode: ‘checkbox’,
    columns: columns
    });

    var value = columns[1].dataField;
    if(searchViewGridDataAdapter.records.length!=1)
    {
    $(“#popupWindow”).jqxWindow(‘show’);
    ShowSearchFieldsLabel(fieldName);
    if($(‘#divLookupSearch’).jqxGrid(‘getselectedrowindexes’).length > 0)
    $(“#divLookupSearch”).jqxGrid(‘clearselection’);

    $(“#txtId”).val(“”);
    $(“#txtName”).val(“”);
    }
    else
    {
    AddNewFilter(searchViewGridDataAdapter.records[0],value);
    $(“#txtValue”).val(“”);
    }
    };

    Is there any better approach to implement this scenario
    I am using jQWidgets 3.0.4?
    Awaiting your reply

    Error while reloading grid #47665

    Peter Stoev
    Keymaster

    Hi Yogesh Singh,

    To update the Grid’s data you should set its “source” property to a new DataAdapter instance, or if you want to use the same dataAdapter, just call “updatebounddata”.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Error while reloading grid #47690

    Yogesh Singh
    Participant

    Peter,

    I have a text box in which user enters data to search and on button click i populate grid the search result and based on the returned result set length i have to display the grid with search result in a popup
    so for first time it works fine but i am not displaying grid in popup based on condition but in the second time it gives me the above error this time grid will be shown in popup even i am just displaying the same grid with another search result
    i am passing column array to grid’s column property since based on search type i need to display different columns
    it doesn’t break the UI it displays the grid properly when i go ahead and ignore the error.
    and its only replicable in the scenario which i have mentioned otherwise it works fine

    Error while reloading grid #47692

    Peter Stoev
    Keymaster

    Hi Yogesh Singh,

    If you want to dynamically update the Grid’s source, you have to dynamically set its “source” property.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.