jQWidgets Forums

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Select all event Select all event #95855

    heer
    Participant
    in reply to: Select all event Select all event #95852

    heer
    Participant

    Solved:

    The events “rowselect” and “rowunselect” does not really work as expected:

    rowselect fires
    1. When a row is selected
    2. When all rows are selected by clicking the “select-all-checkbox”
    3. When all rows are UNselected by clicking the “select-all-checkbox”.

    rowunselect fires
    1. When a row is unselected
    Note: rowunselect does NOT fire when all rows are unselected using the “select-all-checkbox”.

    Solution (using an un-documented feature):
    In the case “rowselect” was fired when clicking the “select-all-chenbox” the event-argument event.args.rowindex of the handler holds an array of indexes to the selected rows. i.e. an array of all indexes OR an empty array. By checking the length of the array you will know!

    Example:

    
        $("#theGrid").bind('rowselect', function (event) {
            if (Array.isArray(event.args.rowindex)) {
                if (event.args.rowindex.length > 0) {
                    alert("All rows selected");
                } else {
                    alert("All rows unselected");
                }
            } else {
                alert("Selected row has index = " + event.args.rowindex);
            }
        });
    
        $("#theGrid").bind('rowunselect', function (event) {
            alert("Unselected row has index = " + event.args.rowindex);
        });
    
    in reply to: Select all event Select all event #95838

    heer
    Participant

    Any ideas on how to implement the “unselect all”-event? The rowunselect-event does not fire when unselecting all rows by clicking the header-checkbox.

    Thanks in advance // Henrik


    heer
    Participant

    Bump, Peter!

    I would also like a better description of the differences between refreshdata and updatebounddata.

    What does bound actually stand for in this case?

    Kind regards
    // Henrik

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