jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Widgets in cells
Tagged: #jqwidgets-grid, grid, javascript grid, jquery grid
This topic contains 11 replies, has 2 voices, and was last updated by Pfhoenix 8 years, 1 month ago.
-
AuthorWidgets in cells Posts
-
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?
Hello Pfhoenix,
I tested this example and it seems to work fine (I mean
cellvaluechanged
event in combination withcreateeditor
).
Could you give more details what you want to achieve?Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comI 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.
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 thecreateeditor
after setting some value by a Widget this will change the value in the cell and this will invoke thecellvaluechanged
.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comYou 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?
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 HristovjQWidgets team
http://www.jqwidgets.comI’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.
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 HristovjQWidgets team
http://www.jqwidgets.comYour 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.
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 withgeteditorvalue
callback.
Please, take a look at this example:
http://jsfiddle.net/mfqk8uwf/Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comI 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.
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.
-
AuthorPosts
You must be logged in to reply to this topic.