valentincognito
11/2/2016 - 2:21 AM

jqxGrid

jqxGrid

var source =
{
    datatype: "json",
    datafields: [
        { name: 'id'},
        { name: 'title'}
    ],
    url: 'url'
};

var dataAdapter = new $.jqx.dataAdapter(source);

$("#jqxgrid").jqxGrid(
{
    width: "100%",
    rowsheight: 30,
    source: dataAdapter,
    pageable: true,
    pagesize: 20,
    autoheight: true,
    sortable:true,
    columns: [
        { text: 'Id', datafield: 'id', width: 50},
        { text: 'Title', datafield: 'title', width: 'auto', minwidth: 220},
        { text: 'Button',datafield: 'Edit', align: 'center',width: 60, cellsalign:'center',cellsrenderer: function (id) {
          return '<div style="padding:5px;" align="center"><input type="button" style="width:50px;"  value="edit" onclick="function('+id+');" /></div>';}
        },
    ]
});