jQWidgets Forums

jQuery UI Widgets Forums Grid Widgets in cells

This topic contains 11 replies, has 2 voices, and was last updated by  Pfhoenix 8 years, 1 month ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
  • Widgets in cells #92454

    Pfhoenix
    Participant

    When I use CreateEditor for a column (dropdownlist in this particular case), the editor only gets created when the user interacts with the cell. This makes the cell not appear as a dropdownlist initially, and displays the actual value of the item I want selected, as opposed to the desired label in the dropdownlist source. If I use CreateWidget, I lose the ability to use the grid’s cellvaluechanged event for that cell, which is not what I want.

    Is there a way to use createeditor and have it appear when the grid is created, before the user interacts with the cell?

    Widgets in cells #92493

    Hristo
    Participant

    Hello Pfhoenix,

    I tested this example and it seems to work fine (I mean cellvaluechanged event in combination with createeditor).
    Could you give more details what you want to achieve?

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Widgets in cells #92501

    Pfhoenix
    Participant

    I thought I was pretty clear. Let me rephrase :

    createeditor with cellvaluechanged works. When the grid is created, however, that is not when createeditor is called. Createeditor is called the first time the user clicks on the cell. This results in undesirable behavior when using a dropdownlist in the cell, in the form of the dropdownlist not existing, thus not rendering, until the user clicks on the cell. It also displays the value of the cell instead of the desired display text.

    If I create my own dropdownlist using createwidget, I no longer see cellvaluechanged. The only reason I have for creating my own dropdownlist is for the cell to render as desired on grid creation.

    Widgets in cells #92518

    Hristo
    Participant

    Hello Pfhoenix,

    When use createwidget it only affect a visual appearance of one Widget and need additional logic to set value in a particular cell.
    Other side with the createeditor after setting some value by a Widget this will change the value in the cell and this will invoke the cellvaluechanged.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Widgets in cells #92531

    Pfhoenix
    Participant

    You seem to be missing entirely what my question actually is :

    Is there a way, using createeditor, to have the editor created when the row is created, instead of only when the user interacts with the cell?

    Widgets in cells #92563

    Hristo
    Participant

    Hello Pfhoenix,

    Unfortunately, there are no such options.
    If give more details what you want to achieve I maybe could provide you a solution.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Widgets in cells #92594

    Pfhoenix
    Participant

    I’ve setup a jsfiddle that demonstrates the issue I’m seeing :

    http://jsfiddle.net/KCqqG/258/

    On first load, you see the value of the cell as opposed to the desired name, as setup in createeditor. This is the problem – with createeditor being called only on first interaction, dropdownlist cells display incorrectly. I understand that createeditor is working as intended, but I would suggest that there be some event we can use to set initial values of a cell without overriding rendering for the cell. I just want the contents of a dropdownlist cell to display the correct name initially, so users will never see the values themselves.

    Widgets in cells #92596

    Hristo
    Participant

    Hello Pfhoenix,

    Please, take a look at this demo:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/gridkeyvaluecolumn.htm?light
    (If you try to click on cell in the “Employee Name” column. The cell’s label and value will be displayed below the Grid.)
    Hope this helps.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Widgets in cells #92632

    Pfhoenix
    Participant

    Your example doesn’t use createeditor. I don’t know why my direct question is being ignored; I’ve stated clearly twice now in explicit detail the issue and the reproduction case. I even setup a jsfiddle for you to see for yourself. Are you just unable to provide an answer? Is this a mystery? Unadmitted bug? I could understand an initial misunderstanding or confusion, but at this point, I can’t help but wonder if it’s intentional.

    Widgets in cells #92664

    Hristo
    Participant

    Hello Pfhoenix,

    In the previously provided example, I had wanted to suggest you how to match different values by key/value pair.
    You could return the desired value with geteditorvalue callback.
    Please, take a look at this example:
    http://jsfiddle.net/mfqk8uwf/

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Widgets in cells #92751

    Pfhoenix
    Participant

    I found a way around the createeditor behavior : using the column’s displayfield property to set the appropriate initial display text prior to createeditor being called through user interaction.

    Widgets in cells #92827

    Pfhoenix
    Participant

    I just want to add that the last jsfiddle, meant to provide an alternative solution to my question, itself displays the exact issue I was describing.

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

You must be logged in to reply to this topic.