jQWidgets Forums

jQuery UI Widgets Forums Grid Adding empty row to father grid in nested grids

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 8 years ago.

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

  • gtocuyo
    Participant

    Hi,

    I’ve a blank (empty) grid with three different models of child empty (as well) grids nested to it (depending on one father row’s cell selected value).

    If I select some value of the first cell of the first row of principal grid, it nest the proper grid to that row correctly, then I can continue filling up the child grid without problems.

    But, I’ve a custom behaviour which adds a new empty row to the father grid on the cellvaluechanged event of any cell of the last row in order to allow users to keep typing data because I don’t know at the beginning how much rows will the user need.

    So, in that event, I’m having a rare issue with the “addrow” method: The data of any child grid previously created is lost…

    I’m adding the new row in the father grid like this:

    .on('cellvaluechanged', function (event) {
    
            var _grid = DetallesComprobante.filterGridDetail.getGrid();
    
            var isUltimaFila = (event.args.rowindex === (_grid.jqxGrid('getrows').length - 1));
            if (isUltimaFila) {
                var newRow = {};
                _grid.jqxGrid('addrow', null, newRow);
            }

    Can you give me some guidance about commented issue? Is it possible that “addrow” method make some sort of “refresh” of the entire grid before adding the new row so it lost the references to the nested grids and then show them empt???

    Thnaks a lot for any comment.


    Hristo
    Participant

    Hello gtocuyo,

    There is no sorting or filtering when use addrow method.
    I would like to suggest you use more specific identification when you create a NestedGrid and could use record argument from initrowdetails (index, parentElement, gridElement, record)
    You could use uid (or something unique if you add rows with ID) of the record‘s object.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.