First, let me point out that the code works perfectly on the first load. However, on the postback, the Telerik controls are not ready yet.
So I'm doing a simple loop through the grid:
See the line where I call
Here is a sample of the difference between the first page load (which works) and the postback.
broken code (line 83):
working code (line 83):
Any ideas?
So I'm doing a simple loop through the grid:
var tempValue = new Array(0, 0, 0, 0, 0, 0, 0, 0);var senderId = sender.get_id();var telerikControl;var grid = $find("<%= uxGrid.ClientID %>");var rows = grid.get_masterTableView().get_dataItems();var rowCount = rows.length; // make loop run fasterfor (i = 0; i < rowCount; i++) { // foreach row for (j = 1; j <= 7; j++) { console.log(rows[i].get_element()); telerikControl = rows[i].findControl('uxHours' + j); if (telerikControl == null) { console.log('could not find control "uxHours' + j + '" in row ' + i + '; updateDaySummaries initiated by ' + senderId); } if (telerikControl.get_value().length != 0) { // do NOT use greater than //console.log('adding ' + telerikControl.get_value() + ' from ' + telerikControl.get_id() + ' to tempValue[' + (j - 1) + ']:' + tempValue[j - 1]); tempValue[j - 1] += telerikControl.get_value(); } }}See the line where I call
console.log(rows[i].get_element()); ?Here is a sample of the difference between the first page load (which works) and the postback.
broken code (line 83):
<div style="z-index: 6000;" class="rcbSlide"><div style="display: none; width: 175px;" class="RadComboBoxDropDown RadComboBoxDropDown_Default " id="ctl00_bodyContentPlaceHolder_uxContainer_uxGrid_ctl00_ctl04_uxServiceList_dropDown_DropDown"><div style="height: 150px; width: 100%;" class="rcbScroll rcbWidth"><ul style="list-style: none outside none; margin: 0pt; padding: 0pt;" class="rcbList"><li class="rcbItem ">Business Development</li></ul></div></div></div><input type="hidden" name="ctl00_bodyContentPlaceHolder_uxContainer_uxGrid_ctl00_ctl04_uxServiceList_dropDown_ClientState" id="ctl00_bodyContentPlaceHolder_uxContainer_uxGrid_ctl00_ctl04_uxServiceList_dropDown_ClientState" autocomplete="off" value="{"logEntries":[],"value":"16","text":"Business Development","enabled":true}">working code (line 83):
<input type="hidden" name="ctl00_bodyContentPlaceHolder_uxContainer_uxGrid_ctl00_ctl04_uxServiceList_dropDown_ClientState" id="ctl00_bodyContentPlaceHolder_uxContainer_uxGrid_ctl00_ctl04_uxServiceList_dropDown_ClientState" autocomplete="off" value="{"logEntries":[],"value":"16","text":"Business Development","enabled":true}">Any ideas?
