jQWidgets Forums

jQuery UI Widgets Forums Grid jqxSwitchButton in jqxGrid

This topic contains 2 replies, has 2 voices, and was last updated by  klien54 8 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • jqxSwitchButton in jqxGrid #85481

    klien54
    Participant

    Hi team,

    I’d like to know how to create jqxSwitchButton Widget in jqxGrid.
    I thought createwidget api could do this, but it doesn’t recognize jqxSwitchButton.
    Here is some of my code for creating a jqxSwitchButton in a column.
    Would you give me an advice how to create it please?

    
    ...
    columntype: 'custom',
    createwidget: function (row, column, value, cellElement) {
                    // add widget's html element to the cellElement and then create the widget.
                    var buttonDiv = $("<div id='switch_" + row.boundindex + "'></div>");
                    $(cellElement).append(buttonDiv);
                    buttonDiv.jqxSwitchButton({
                        height: 27,
                        width: 81
                    });
    },
    initwidget: function (row, column, value, cellElement) {
                    // update the widget by using its cellElement.
                    console.log("initwidget");
    },
    ...
    
    jqxSwitchButton in jqxGrid #85483

    ivailo
    Participant

    Hi klien54,

    Here is a demo with your code and it seems to work as expected.
    Also you can update to the latest version(4.1.2).

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    jqxSwitchButton in jqxGrid #85485

    klien54
    Participant

    Hi, ivailo.

    Thank you for your prompt help.
    I found my mistake in my sample since you adviced me to use the latest version.
    The library that I imported was wrong.
    Thanks again.

    Warm Regards,
    klien54

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

You must be logged in to reply to this topic.