jQuery UI Widgets Forums DataTable Dynamic DataTable

This topic contains 7 replies, has 2 voices, and was last updated by  Dimitar 10 years, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • Dynamic DataTable #64196

    simcon94
    Participant

    Hi,
    i have a dynamic DataTable. I can set the Rows and Columns via InputField.
    No i want to select the Rows dynamically.
    When i choose the amount of selection, f.e 2 rows (via Combobox), i only want to select two rows.
    Is this possible?

    Dynamic DataTable #64200

    Dimitar
    Participant

    Hello simcon94,

    You just have to call the method selectRow as many times as the amount set in the combobox.

    Best Regards,
    Dimitar

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

    Dynamic DataTable #64207

    simcon94
    Participant

    OK.
    Can i get the “getselectedcells” without a button click?
    I wanted to know, how many cells i selected.
    I have this mode:
    .jqxGrid(“selectionmode”, “multiplecellsextended”);

    Dynamic DataTable #64212

    simcon94
    Participant

    I wanna do something like this:

    //CELLSELECT EVENT
            $("#matrix").bind("cellselect", function (event) {
                cells = $("#matrix").jqxGrid("getselectedcells");
                var groupsSize = $("#Matrix_Groups").val();
                if (cells.length === groupsSize) {
                    console.log("READY");
                }
                else if (cells.length > groupsSize) {
                    $("#matrix").jqxGrid('clearselection');
                } 
            });
    

    The console.log() fires every time, when the selction == groupSize.
    I only want to have this condition, when my selection is finished(mouse event)

    Dynamic DataTable #64228

    Dimitar
    Participant

    Hi simcon94,

    Are you referring to jqxDataTable or jqxGrid? These widgets, while similar in appearance, have different API.

    As for your question – unfortunately, there is no event that fires after the last cell has been selected when selectionmode is “multiplecellsextended”. Maybe you will be able to create a custom mouseup binding which suits your purposes.

    Best Regards,
    Dimitar

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

    Dynamic DataTable #64231

    simcon94
    Participant

    Sorry, have grid.
    Do you have an example?

    $("#matrix").mouseup(function() {            
                var groupsSize = $("#Matrix_Groups").val();            
               if (cells.length > groupsSize) {
                    $("#matrix").jqxGrid('clearselection');                    
                } else if (cells.length === groupsSize) {
                    $("#popUpBit").jqxWindow('open');
                }

    I tried this way.
    This is OK, when you selected the cell with CTRL and Mouse Click. But not, when you select the cell with mouse and pressed mouse button….

    Dynamic DataTable #64252

    simcon94
    Participant
    $("#matrix").mouseup(function () {
                cells = $("#matrix").jqxGrid("getselectedcells");
                console.log("Seleted Cells:  " +cells.length);     
           });

    SELECTED CELLS IS ALWAYS 1….hmmmmmm

    Dynamic DataTable #64302

    Dimitar
    Participant

    Hi simcon94,

    Maybe you need to call the mouseup event handler code with some delay, e.g.:

    $("#matrix").mouseup(function () {
        setTimeout(function () {
            cells = $("#matrix").jqxGrid("getselectedcells");
            console.log("Seleted Cells:  " + cells.length);
        }, 500);
    });

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.