-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug in processing custom-element fields in an edit form #1018
Comments
Just a small update: https://guriddo.net/?kbe_knowledgebase=using-datalist-drop-down-menu-in-form-edit |
I'm just going to ask - you why you set the input with this class? Thanks anyway. |
Thanks Udi, This was definitely wrong setting in the input. The reason that it was set wrong was to preserve the css style for the input missing that it not should be set. I have fixed both the code and the article. Thank you very much again. Tony. |
Hi Tony,
I'm having some trouble with implementing a Custom Element and going through the jqGrid code I see something strange. Perhaps you can help to clarify whether this is a problem or not.
I'm trying to implement an HTML5 input with datalist. You even have a nice article written on this topic. But my element needs to work somewhat like a "select", returning a "key" instead of the actual value in the input. This means that the custom-value function is critical for reading the correct value out of this field.
When creating a Custom Element in form-edit mode, the HTML structure looks like this:
As you can see, both the "span" and the "input" have the "FormElement" class.
Now my problem is in the "getFormData()" function of jqGrid (see below).
In line #11467 we pull out all the items with ".FormElement". This would include both the "span" AND the "input".
Then in line #11468 we pull out all the items with ".customelement" INSIDE the ".FormElement". When we do that for the "span", we get the "input" which is inside. But when we do that for the "input" itself, we get an EMPTY list!
Now the problem is that in line #11469 we check if the list is empty and if it is, we try to read the item as a "non-custom". Eventually we reach line #11508 and then just read the simple value out of the "input".
In my case, I see the custom-value function IS being called once and IS returning the correct data, but eventually jqGrid is sending the raw value of the input item to the server.
Since we are reading the value for the same "name" twice, the later will override the former. Eventually the value received from the custom-value function will be overridden.
Is this a bug?
jqGrid/js/jquery.jqGrid.js
Lines 11465 to 11509 in a00419f
The text was updated successfully, but these errors were encountered: