njcalugar

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • in reply to: Formatter Checkbox handle change event #92105
    njcalugar
    Participant

    I think I'm doing the colModel incorrectly – I am using PHP code to generate the grid configuration and json_encoding a PHP array isn't correct because all the keys and string values are enclosed in quotes.

    in reply to: Formatter Checkbox handle change event #92104
    njcalugar
    Participant

    I can't get it to call my custom function, i'm trying to make sure it is getting called so I have an alert in the function and it is simply returning 'hello':

    $(document).ready(function() {

    jQuery("#listZones").jqGrid({
    url: '/onemedia/creative/edit-get-zones/id/6',
    datatype: 'json',
    mtype: 'POST',
    multiselect: false,
    colModel: [{"name":"id","index":"id","width":1,"hidden":true,"key":true},{"label":"Items","name":"name","index":"name","sortable":false},{"label":"Linked","name":"link","index":"link","sortable":false,"width":60,"align":"center","formatter":"customFormat"},{"label":"CHECK TEST","name":"checkTest","index":"checkTest","sortable":false,"width":60,"align":"center","formatter":"checkbox"}],
    pager: jQuery('#pager'),
    rowNum: 10,
    rowList: [10,20,30,40,50],
    sortname: 'id',
    sortorder: 'asc',
    viewrecords: true,
    imgpath: '/js/jqGrid/themes/steel/images',
    caption: 'Applications / Zones',
    width: 600,
    height: 'auto',
    gridComplete: function(){ },
    ondblClickRow: function(rowid, iRow, iCol, e){ },
    onSelectRow: function(rowid, status){ },
    treeGrid: true,
    treeGridModel: 'adjacency',
    ExpandColumn: 'name',
    cellEdit: false,
    cellsubmit: 'remote',
    cellurl: ''
    });

    });

    function customFormat(cval, options, rowObject) {
    alert('here');
    var checked = (cval == 'yes')?" checked='checked'":"";
    return "hello";
    }

    in reply to: Formatter Checkbox handle change event #92010
    njcalugar
    Participant

    I figured how to get the values when a “Save” button is clicked by using the getCol method.

    Anyone know how to add a click event to the inputs created by the checkbox formatter?

Viewing 3 replies - 1 through 3 (of 3 total)

Stay connected with us in your favorite flavor!