jQWidgets Forums

jQuery UI Widgets Forums Grid jqxgrid rowselect/rowunselect Help

This topic contains 4 replies, has 3 voices, and was last updated by  admin 8 years, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • jqxgrid rowselect/rowunselect Help #90548

    dan123
    Participant

    Hi I wanted help on this jqxgrid rowselect where suppose let me do a illustration

    Rowselection:
    Grid (Customer)
    Columns: id Store Location
    1 Pizzastore USA –> Row fetched

    Grid (Orders) ——> rowselect event from this grid
    Columns: id Item Price
    1 Bread $2.00 –> Selected
    1.1 Oil $3.50 –> Selected
    1.2 Sauce $4.20

    OR:
    Grid (Customer)
    Columns: id Store Location
    1 Pizzastore USA –> Row fetched

    Grid (Orders) ——> rowselect event from this grid
    Columns: id Item Price
    1 Bread $2.00 –> Selected
    1.1 Oil $3.50
    1.2 Sauce $4.20

    On rowselect from the Orders grid, If I selected rows 1 with item (Bread) and 1.1 with item (Oil). I want the Customer grid to update source and show that row with value Pizzastore. But I only want it to show one row. So for instance I just selected row 1 with item (Bread), then it will update the source of the Customer grid and show that row about Pizzastore. Now what if I selected again, while that old selection is still there, and selected row 1.1 with item (Oil). This time it should still just update but have only one row with Pizzastore. (No duplicates)

    Row unselect:
    Grid (Customer)
    Columns: id Store Location
    1 Pizzastore USA –> Row fetched

    Grid (Orders) ——> rowunselect event from this grid
    Columns: id Item Price
    1 Bread $2.00 –> unSelected(If clicked)
    1.1 Oil $3.50 –> Selected
    1.2 Sauce $4.20

    Also:

    Row unselect:
    Grid (Customer)
    Columns: id Store Location
    Empty Row

    Grid (Orders) ——> rowunselect event from this grid
    Columns: id Item Price
    1 Bread $2.00 –> unSelected
    1.1 Oil $3.50 –> unSelected
    1.2 Sauce $4.20

    On rowunselect until both rows 1 with item (Bread) and 1.1 with item (Oil) are unselected then only update the source and show empty. So if there is any other selection then keep it.

    http://jsfiddle.net/j97zgoLc/9/

    jqxgrid rowselect/rowunselect Help #90587

    dan123
    Participant

    Need help

    jqxgrid rowselect/rowunselect Help #90588

    Peter Stoev
    Keymaster

    Hi dan123,

    When you select a row, build a new instance of jqxDataAdapter and set the Grid’s source to point to it. If your data is local, it will be easy for you to filter what data goes into your dataAdapter. That is how master-details usually work. In your code, I think the records array is built incorrectly. On each rowselect, records should be initialized i.e records = new Array();

    Best Regards,
    Peter Stoev

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

    jqxgrid rowselect/rowunselect Help #90595

    dan123
    Participant

    Can you show a jsfiddle with an idea of my illustration i did. I wanna know

    jqxgrid rowselect/rowunselect Help #90596

    admin
    Keymaster

    Hi dan123,

    Just use a fresh instance of your “records” variable every time, instead of just filling it with new data.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.