Adding Dropdown list to the particular column..using jquery

安稳与你 提交于 2019-12-24 18:53:09

问题


Hi I need to append the dropdownlist box with certain values to the jquery grid column,

that is default dropdownlist for perticular column....

I am using this type of jQuery grid

http://www.trirand.net/demoaspnetmvc.aspx

can anyone help me out..

Thanks


回答1:


You can pretty much add any html to your data in the grid, for example:

$("#grid").jqGrid('addRowData', 1, {id:"1", name:"Joe Developer", division:"<select><option value='1'>Division 1</option><option value='2'>Division 2</option><option value='3'>Division 3</option></select>"});



回答2:


Something like will add a select to the forth column of a grid.

 $(function () {
        $.each($('#myTable td:nth-child(4n)'), function () {

            var forthColumn = $(this);

            forthColumn.append('<select/>');
        });
    });

I hope this helps



来源:https://stackoverflow.com/questions/2759837/adding-dropdown-list-to-the-particular-column-using-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!