jQuery UI Widgets Forums Grid dropdownlist with checkboxes type cells

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

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

  • sinch
    Participant

    Good day,

    there seems to be a bug in version 3.2.2 with the DropDownList cell type,
    if a cell is a dropdownlist without checkboxes it’s working, if I set checkboxes: true, when I open the cell it dies with a “TypeError: e[0].firstChild is null” error message. Just to be sure, I switched back to version 2.9.3 and there it’s working with that version.

    Any quick solution to bypass this?
    Thank you.


    Peter Stoev
    Keymaster

    Hi flevi,

    There is no DropDownList Editor with Checkboxes in jqxGrid or at least I do not know about such Editor. If you want to create a Custom Editor which uses the jqxDropDownList widget with enabled Checkboxes, then you should use this approach: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/cellcustomediting.htm?arctic which demonstrates how to create such custom editor in jqxGrid.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    sinch
    Participant

    Hi,
    thank you for your reply, your example page solved the problem, I was following the http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-cells-editing.htm page where it states:
    To specify the column's editor, you should set the column's 'columntype' property to 'textbox', 'dropdownlist', 'numberinput', 'checkbox' or 'datetimeinput'.
    now, in your example, it’s columntype: ‘template’, and I was using columntype: ‘dropdownlist’, did I misunderstand something here?

    Thank you again.


    Peter Stoev
    Keymaster

    Hi flevi,

    Ok, do you see checkboxes when you just set the columntype to “dropdownlist”? I suppose that you do not and most probably you overrided the default behavior by using createeditor or initeditor callbacks, but you did not override the geteditorvalue. Am I right? Please, look at the sample I sent you which shows how a Custom Editor should be created.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    sinch
    Participant

    Hi,

    The geteditorvalue is overwritten, and I see no checkboxes with columntype dropdownlist because it the dropdownlist doesn’t open at all, it just gives that js error I mentioned above, but I did create the dropdown list in the initeditor, not in the createeditor, like so:
    I think I’m confusing version 2.9 with 3.2. At least in v2.9 it worked like this (but in 3.2.2 it’s not working any more):

    { text: 'ID Column', datafield: 'id', width: '20%', columntype: 'dropdownlist', 
    initeditor : function(row, cellValue, editor)
    {
         editor.jqxDropDownList({
                checkboxes: true,
                source: dataAdapter, 
                valueMember : "id", 
                displayMember : "label"});
    },

    Now, as I seen in the example link you provided, this “editor.jqxDropDownList” goes into the createeditor function (not into the initeditor like it worked with v. 2.9) and the comlumntype should be template (instead of ‘dropdownlist’), then it’s working properly.
    My problem is that I didn’t see in the docs the “columntype: template” yet (or I missed it), so I’m not understanding something … can you please explain this for me? (I’m guessing here but without the checkboxes: true, and with the columntype ‘dropdownlist’ it’s working, so is the combobox, so when is it appropriate to use the “template” column type in the grid?)

    Thank you again.


    Peter Stoev
    Keymaster

    Hi flevi,

    Let me explain something – by setting initeditor, createeditor and geteditorvalue you customize and override the default/built-in Editing behavior. We cannot guarantee that any custom code not written by us will work. So scenario with DropDownList with Checkboxes has never been supported by jqxGrid. The column types are documented in the API Documentation: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-api.htm. You can read about them in the columns section. Recently, we added the capability to create Custom Editors in jqxGrid and we added examples about that. I pointed you out such sample, which demonstrates how to create a custom DropDownList Editor with Checkboxes.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    sinch
    Participant

    Hi,

    thank you, but you didn’t understand me at all, and I still can’t find in the documentation what is the columntype: ‘theme’ and when to use it, but none the less, it’s working with that, so thank you again.


    Peter Stoev
    Keymaster

    Hi flevi,

    Open the Documentation page, go to jqxGrid API, expand “columns” and you will find it.

    Best Regards,
    Peter Stoev

    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.