Menu

Checkboxes in LiveGrid

Help
2010-01-24
2012-12-11
  • Neil Franken

    Neil Franken - 2010-01-24

    Hi People

    I have got a problem with the livegrid's behaviour. Basically I got a table about 80 items one column wide that I put into a html table and then I hook up the table to a livegrid. The column is a check box input element with a description. Basically it is a list of departments with a checkbox element. I dont need or want to use ajax as it is a simple screen. I want the user to be able to select a checkbox mark it as true and then submit the data. It all works but as soon as you sort,scroll or filter the newly checked check boxes loose their value.  This is quite frustrating. I have been looking into the problem and I assume it is due to the fact that the checked="true" property is not set in the html. Is there a way I can access the buffer of the livegrid and make sure these values are stored and not reread from the html?

    Any help would be appreciated.

    Cheers
    Neil

     
  • Anonymous

    Anonymous - 2010-02-12

    buffer.setValue(row,col,newcb)

     
  • Anonymous

    Anonymous - 2010-02-12

    sorry should be :

    function ToggleCheckbox(id){
        var newcb="<input type='checkbox' id='"+id+"' onclick='ToggleCheckbox(this.id)'" + ($(id).checked ? ' checked' : '') + ">" ;
        var params=id.split('_');
        var row=params[0];
        var col=params[1];
        buffer.setValue(row,col,newcb);
    }
    

    this assumes that your initial <input> has the id set as rownum_colnum and it's onclick set to ToggleCheckbox(this.id)

     

Log in to post a comment.