jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Add row doesnt display dropdown items
Tagged: add row, addrow, angular grid, array, createeditor, dropdown, DropDownList, editor, grid, jqgrid, jquery grid, jqxgrid, source
This topic contains 3 replies, has 2 voices, and was last updated by ashwin prabhu 9 years, 8 months ago.
-
Author
-
Hi,
I have a grid data and a add row button. When a add row button is clicked, an entire new row of empty data gets added at the first line. Here is the code for that.
function addrow() { var row = { Order: null, Id: null, Id_type: '', }; \$("#jqxgrid").jqxGrid('addrow', null, row, 'first'); }
This above code with execute when user clicks on “Add Row” tab. Once clicked, an empty row with columns like “ORder, Id, Comment, Id_type will be created. however, i dont want the Id_type to be blank. I want it to be a list of dropdown box. How can i ensure that the list of dropdown will be displayed when the user clicks on that particular cell.
here is the dropdown menu which should be available when user clicks on the column which has Id_type. Can anyone suggest ?
var Id_type = ["Country","Industry", "Sedol","Sector"];
Hi Team,
To elaborate on this issue, please refer to this linkhttps://www.jseditor.io/?key=dropdown-menu-issue-of-column-id-type
1) If we click on the cells under column ‘Id_type’, we can see only 2 drop down items. Sector and Sedol are only visible in the dropdown menu whereas in the codee we have specified as follows
var Id_Type = ["Country", "Sector", "Industry", "Sedol"];
It means it should display all the four options in the dropdown. This is one error i am facing.
2) If i click on “Add row” button at the top of the table, i cannot see any of the dropdown items. This is the second error. How can i fix this dropdown error when i create a new row.
when i click on the tabs which are under “Edit” column, i can see the dropdown items over there perfectly. I hope i had tried my best to replicate the problem for you to have a look.
Hi ashwin prabhu,
Please update the definition of the column “Id_Type” as follows:
{ text: 'Id_Type', columntype: 'dropdownlist', datafield: 'Id_Type', createeditor: function(row, cellvalue, editor, celltext, cellwidth, cellheight) { editor.jqxDropDownList({ source: Id_Type }); }, width: 80 }
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
Thanks. It worked. -
AuthorPosts
You must be logged in to reply to this topic.