-
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
Proposal for improving feature - Dynamic values for "select" formatter #1049
Comments
Hello Udi, Thanks for the recommendation. I think we can pass the grid element (this) and the options (which contain everything you need). I will refer this issue when these are added. Thank you |
…t when it is a function. See: #1049
You can test the new addition as described into the commit. |
Hi Tony, Well, for having a "full solution", there are 3 places that need to be handled:
#1 looks OK at this time, but in my case I cannot use it without have #2 and #3 working as well. |
The select as function can be used in editoptions and searchoptions. Not sure that the logic you describe should be applied, instead that historically in certain places it is available. |
Hi Tony, When I tried to use the "function" type "value" for the "select" type in formatting, it didn't call the function. I looked at the code and didn't see any checking for type "function" there (I think it's in "jquery.fmatter.js" line 234 and on). I only see checking whether it is a String or an Object. Am I wrong about this location? As for the different options, I understand your point. It's just that I saw the code mentioned above, and saw that it DOES have this fallback from formatoptions to editoptions (line #242). So that is why I was proposing the same line of thinking for searchoptions. But it's OK if you keep them separate. |
Hi Tony,
When using the "select" formatter, the documentation is giving a quick hint that the editoptions.value (and formatoptions.value) can actually be a function.
I see that indeed you can define a function there, for dynamically setting the select options, but there's a problem. This function is getting NO input parameters and "this" is pointing to some internal jqGrid object (not a DOM element).
I think it would be very nice if this function could have some useful parameters, maybe the same as for the custom formatter, and "this" should point to the grid. It would make things easier when implementing dynamic values.
The text was updated successfully, but these errors were encountered: