jQWidgets Forums

jQuery UI Widgets Forums Grid Add Row with returned db id – continued

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

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

  • EricK
    Participant

    On the add row function.

    $(“#Add”).on(‘click’, function () {
    //var datarow = generaterow();
    $(‘#jqxgrid’).jqxGrid({ filterable: false});
    var commit = $(“#jqxgrid”).jqxGrid(‘addrow’, null, {});
    });

    I added the set filterable to false and when I add a row it now disappears.

    Can I disable filtering after it has been setup initially?


    Peter Stoev
    Keymaster

    Hi EricK,

    The row will disappear when it does not meet the filtering criteria. Example: http://jsfiddle.net/jqwidgets/7pSW4/. If you wish, you can clear the filters when you add rows by using the “clearfilters” method.

    Best Regards,
    Peter Stoev

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


    EricK
    Participant

    Hi Peter,
    Ok, the information you provided was very helpful.

    Basically, the filter has no criteria entered. I open the grid with showfilters, the grid is blank with my filter headings.
    Nothing is entered. I select the add function and the grid shows a new row.
    The only data that is returned from the add function is the new record id (generated from the database) and the datafields which are blank.
    The grid should now have a row with the id field populated with a number. I would have thought the new row now has the id when I select it does not.

    Does the grid update itself with the new data automatically or do I have to set each field manually?
    I found out that the grid does not have to be in editmode from your example above.

    From your examples which shows the data fields being populated before the add row is processed and your use of the generatedata.


    Peter Stoev
    Keymaster

    Sorry, Erick, I do not understand what you mean by “Does the grid update itself with the new data automatically or do I have to set each field manually?”. Yes, the Grid updates itself when you pass new data, if that is the question you’re asking.

    Best Regards,
    Peter Stoev

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


    EricK
    Participant

    Hi Peter,
    Do we have an example of ajax php insert into a database that does not pass any data with the insert?

    If not I could send you the sample I have.

    Eric


    Peter Stoev
    Keymaster

    Hi Eric,

    No, we do not have such sample because it does not matter whether you add empty or not empty row.

    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.