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
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
Dylan, thank you for your reply.
I'm actually handling the update if the checkbox is checked part, what I'm trying to do is keep the update from firing when the user selects the checkbox. The grid is set up so that if a user changes a value, it's updated. What I'm trying to do is somehow prevent the update from being fired if they select the checkbox.