jqGrid reload grid

前端 未结 2 1354
时光取名叫无心
时光取名叫无心 2020-12-10 04:11

It\'s an addition for previous my question about adding columns into jqGrid-based table. Here my new js-code:

var col_names = [\'First\', \'Second\', \'Third         


        
2条回答
  •  臣服心动
    2020-12-10 04:32

    You can do about following

    var counter=1; // to be able to click more then one time
    $("#add_column").click(function() {
        $("#list").jqGrid('GridUnload');
    
        col_names.push('New'+counter);
        col_model.push({name: 'test'+counter, index: 'test'+counter, width: 100});
        counter++;
    
        createGrid();
    });
    

提交回复
热议问题