开发者

Adding Dropdownlist Dynamically to the row cell using jquery

I am doing soemthign like this to add dropdownlist for each row dynamically..

 var Click = function() {
    $("#Grid").click(
        $("#showgrid").load('/Products/List/Item/'));
        $.each($('#Grid td:nth-child(4n)'), function() {
         var forthColumn = $(this);
        forthColumn.append("<select><option value='1'>Division 1</option><option value='2'>Division 2</option><option value='3'>Division 3</option></select>");
    })开发者_运维问答;
    };

is this rigth what i am doign here? bec I am not getting the dropdown list on the result grid?

can anybody help me out..

thanks


What you have I think adds the select to each column not row. Although I think its best that the each function anyhow to be a call back function of your load function. as you might try to add the selct when the table is not loaded yet

$("#showgrid").load('/Products/List/Item/'), function(){...code for adding select});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜