jQWidgets Forums

jQuery UI Widgets Forums Scheduler getSelection with cellClick event

This topic contains 4 replies, has 2 voices, and was last updated by  fewr 7 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • getSelection with cellClick event #96503

    fewr
    Participant

    Hello jqwidgets-team,

    how is it possible to find out the resourceId from the current selection/cell in the cellClick event?

    The combination by cellClick and getSelection doesn’t work,
    because the return from getSelection containing the values from the second last selection but not the current selection.

            $("#jqxScheduler").on('cellClick', function (event) {
                var selection = $('#jqxScheduler').jqxScheduler('getSelection');
                if(selection !== null){
                    var resourceId = selection.resourceId;
                    var from = selection.from;
                    var to = selection.to;
                    console.log("resource: "resourceId + " from: " + from.toString() + " to: " + to.toString());
                }
            });

    In other events like contextMenuCreate works $(‘#jqxScheduler’).jqxScheduler(‘getSelection’); like expected.

    getSelection with cellClick event #96521

    Peter Stoev
    Keymaster

    Hi fewr,

    Through the event arguments, you can get which exactly cell is clicked and it’s date is available, too.

    Best Regards,
    Peter Stoev

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

    getSelection with cellClick event #96544

    fewr
    Participant

    Hi Peter,

    yes, it’s easy to get the date.
    But i need to know the “resourceId” too (this value isn’t part of the argument from the cell click event).

    I wish you a nice weekend.

    getSelection with cellClick event #96547

    Peter Stoev
    Keymaster

    Hi fewr,

    You still can get it. The “cell” argument has data-view attribute which is the resource number.

    Best Regards,
    Peter Stoev

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

    getSelection with cellClick event #96660

    fewr
    Participant

    Hello Peter,

    yes, The “cell” argument has data-view attribute.
    But it contains not the resource number but rather the column number.

    $(“#jqxScheduler”).on(‘cellClick’, function (event) {
    var dataview = event.args.cell.attributes[1];
    }

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

You must be logged in to reply to this topic.