Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
280
Disable postback on checkbox select
posted

I have an ultraWebGrid that has a column of checkboxes.  I have a function that will update every column in a row if the user selects the checkbox for that row and then presses a button.  The grid also has the update functionality enabled so users can edit individual cells.

The problem I'm having is that the checkboxes are initiating a postback and I don't want them to do that.  All the checkboxes need to do is provide a flag so that the functionality to update multiple rows knows which rows to update.  I've implemented the following BLOCKED SCRIPT

function setCheckBoxCancelPostback(gridName, cellId, button)
{
var last_char = cellId.charAt(cellId.length - 1);

if(last_char < 4)
{
var rowObj = igtbl_getRowById(cellId);

igtbl_cancelPostBack(rowObj.gridId)

if (last_char == 1)
{
rowObj.getCellFromKey('CheckBox').setValue(true);
}

return true;

 

 

But it only works on every other row.  Seems to me there should be a way to disable a specific column from posting back but I can't find anything like that anywhere.

Thanks,

N

Parents
No Data
Reply
  • 255
    posted

    I have a similar UltraWebGrid that I used with a column of checkboxes that only updates if that column in the row is checked.  I used the UpdateRowBatch event procedure.  Here is the code I used within that procedure.  I use and arraylist to capture that row and in another procedure my save event I step through the arraylist and obtain the values for the parameters I am using to update my database. 

     

     

     

    If

     

     (e.Row.Cells(ColumnIndex("Accept")).Value) = 1 Then

     

     

    Dim aa As ArrayList = Me.Session.Item("ApprovalArray")

     

     

    If (IsNothing(aa)) Then aa = New ArrayList

    aa.Add(e.Row)

    Session.Item("ApprovalArray") = aa

     

     

    End If

Children