| Issue 311: | Dynamic drop down values for a column based on the selection of value from the different column | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Jeff, I do not know where to post this so I am posting it here. I have a requirement of having a dynamic table which has the columns with dynamic drop downs. For example: For a given row, lets say we have 2 columns - column A and column B and both are drop downs and the user makes the selection from the drop downs. The column B drop down changes dynamically based on the selection of column A. I do not know how to implement this in Jmesa. I would really appreciate if you could suggest me how to implement this scenario. Is it possible in Jemsa ? I am using 3.0.3 version of Jmesa. Thanks,
Apr 3, 2011
Project Member
#1
jeff.johnston.mn@gmail.com
Apr 4, 2011
Thanks!! Jeff for the quick response. From what I understand, filter dropdown is the one which appears on the top of the column... just like 'career' filter in the worksheet example. But what actually need is a droplistworksheet editor which refreshes the column B cell droplist based on the selection of the Column A droplistworksheet cell. Example: Column A worksheet cell has dropdownvalues (can be populated by setting the droplistworksheeteditor on the htmlcolumn ) - 'Code A', 'Code B', 'Code C'. If the user selects - 'Code A' then the column B should populate Code A related values - in this case it will be 10,20,30 (it should fetch these values from the database dynamically). If user selects Code B then the Column B should be refreshed with the values - 40,50,60 for the Code C - the values should be 70,80,90,100. I really appreciate if you could let me know if it can be implemented in Jmesa. If not, is there any workaround for doing this. Thanks!!!
Apr 4, 2011
If the first filter dropdown does a page refresh (the default behavior) then you can limit the data of the second filter based on the filter value of the first. That is why you would have to get the Limit information to find out how the first dropdown was filtered. If you do not do a page refresh for the first dropdown then you could use a custom filter editor with some JavaScript. You would have to conform to the JMesa parameter naming convention but it would work.
Apr 4, 2011
The JavaScript way would be more work because you would have to understand more about how JMesa works...
Apr 6, 2011
Jeff, Will I be using droplistfilterdropdown or droplistworksheeteditor to achieve this??? I am bit confused here. In my scenario - Add new row(Row1) in the worksheet by clicking the - 'Add Row' icon For Row 1 - I can select option 'Code A' from column A and the column B (row 1) gets refreshed with the appropriate values. (10,20,30) Add second row(Row2) in the worksheet by clicking the - 'Add Row' icon. For Row 2 - I can select option 'Code B' from Column A and the column B (row 2) gets refreshed with the appropriate values.(40,50,60) Thanks!! Jeff.
Apr 6, 2011
Sorry, I did not realize that you were trying to do this with the worksheet. I actually have code that does what you need using a jQuery autocomplete plugin. I had the same requirement recently. The integration points are even built into JMesa 3.0.4. I know you are asking about using the droplist and not autocomplete, but it can be a better user experience. How about if I write up a wiki page that explains it...I need to write something about it anyway. I can do that this week (maybe even over lunch today depending on how long it takes)! Then you can adapt it to the droplist if you need to.
Apr 6, 2011
Thanks!! Jeff for the quick response. This is what I was looking for a while now. In the mean time if you have any example code that does this, please let me know. I will take a look at it and try to implement it in my application. Thanks!!
Apr 6, 2011
Here you go! Be sure to upgrade to JMesa 3.0.4. https://code.google.com/p/jmesa/wiki/AutoCompleteWorksheetEditor
Apr 6, 2011
Thanks! Jeff. |