Question: I want to save value TRUE if checkbox checked, and FALSE if it is unchecked in an array, how can I do that. I have implemented checkbox in tableview. Code is,

```
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    BOOL checked = [[checkedArr objectAtIndex:indexPath.row] boolValue];
    [checkedArr removeObjectAtIndex:indexPath.row];
    [cheval insertObject:(checked) ? @"FALSE":@"TRUE" atIndex:indexPath.row];
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    UIButton *button = (UIButton *)cell.accessoryView;
    UIImage *newImage = (checked) ? [UIImage imageNamed:@"tick.png"] : [UIImage imageNamed:@"white_bg.png"];
    [button setBackgroundImage:newImage forState:UIControlStateNormal];
    cell.accessoryView=button;
}

```

Answer: 
You don't need to bind `click` event handler to *every* button in the column. Every binding take memory and other resources of web browser. The most events bubbling to from inner to outer DOM element (see [here](http://en.wikipedia.org/wiki/DOM_events#Event_flow)), Mouse click, Keyboard keydown, Touch touchstart and other events on the button inside of grid will be bubble to the grid's `<table>` element. jqGrid register by default `click` event handler on the grid. It calls `beforeSelectRow` and `onCellSelect` callbacks and trigger `jqGridBeforeSelectRow` and `jqGridCellSelect` events from the event handler. So instead of binding your own `click` event handlers on every button it's enough to use one from listed above callbacks or events. `beforeSelectRow` (or `jqGridBeforeSelectRow`) will be used first. The callback is practical if you what that click on the button don't select the corresponding row. [The answer](https://stackoverflow.com/a/16241558/315935) for example shows how to verify whether the column which you needs are called. [Another answer](https://stackoverflow.com/a/14537512/315935) provides an example which will be very close to what you need. [One more answer](https://stackoverflow.com/a/13765086/315935) gives you another code fragment. To see more my old answers about the subject you can use [the following query](https://stackoverflow.com/search?q=user:315935%20%5Bjqgrid%5D%20%2bonCellSelect%20%2bbeforeSelectRow%20).

**UPDATED**: the demo <http://jsfiddle.net/ShKDX/82/> is modification of the demo posted by Manuel van Rijn. It demonstrates what I mean.
Here's an simple example how you could add buttons dynamically to a jqgrid

<http://jsfiddle.net/ShKDX/1/>

Not sure if you first row is the id as specified in the fiddle, but you can modify it to use the correct data from the `afterInsertRow` function

```
var data = [
    {id: 1, text: 'row1'},
    {id: 2, text: 'row2'},
    {id: 3, text: 'row3'},
    {id: 4, text: 'row4'},
    {id: 5, text: 'row5'},
];
$("#grid").jqGrid({
    datatype: "local",
    height: 250,
    colNames: ['Id', 'Text', 'edit'],
    colModel: [
        { name: 'id', index: 'id', sorttype: "int" },
        { name: 'text', index: 'text' },
        { name: 'edit', index: 'edit', align: 'center', sortable: false, width: '40px' }
    ],
    caption: "Custom buttons",
    data: data,
    afterInsertRow: function(id, currentData, jsondata) {
        var button = "<a class='gridbutton' data-id='"+id+"' href='#'>edit</a>";
        $(this).setCell(id, "edit", button);
    },
    loadComplete: function(data) {
        $(".gridbutton").on('click', function(e) {
           e.preventDefault();
           alert('Edit id: ' + $(this).data("id"));
        });
    }
});

```