Hi, after updating to the last version, this client code stop fonctionning:
i got a not defined error on the MasterTableView
I try this:
for (var i = 0; i < grid.MasterTableView.SelectedRows.length; i++)
{
...
}
i got a not defined error on the MasterTableView
I try this:
for
(var i = 0; i < grid.get_masterTableView().SelectedRows.length; i++)
{
...
now i got this objet do not have this properties.
any suggestion? Thanks
3 Answers, 1 is accepted
0
Hello Pierre,
Here is an example:
for (var i = 0; i < grid.get_masterTableView().get_selectedItems().length; i++)
{
// your code goes here
}
Greetings,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Here is an example:
for (var i = 0; i < grid.get_masterTableView().get_selectedItems().length; i++)
{
// your code goes here
}
Greetings,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 16 Dec 2008, 01:16 PM
I got the same error: here all the function. Can you help my to convert it correctly?
function OnLogoChange(sender, eventArgs) |
{ |
<telerik:RadCodeBlock runat="server"> |
var grid = window["<%= RadGridComm.ClientID %>"]; |
</telerik:RadCodeBlock> |
for (var i = 0; i < grid.get_masterTableView().get_selectedItems().length; i++) |
{ |
var Row = grid.get_masterTableView().get_selectedItems()[i]; |
var ID = grid.get_masterTableView().GetCellByColumnUniqueName(Row, "ID"); |
var oWindow = radopen ("/Site/Usager/ChangePhoto.aspx?sUID=" + ID.innerText + "&sType=Logo", "ChangeLogo"); |
} |
} |
0
Hi Pierre,
I looked at your code and here are my findings:
All the best,
Iana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I looked at your code and here are my findings:
- The RadCodeBlock control should not be placed inside a client function. It should surround the <script> tag. Find more infomration about RadCodeBlock here.
- In order to access the grid client-side object, you need to use the $find() method as described here.
Please try modifying your code as below and let me know if it makes any difference:
<telerik:RadCodeBlock runat="server" ID="RadCodeBlock1"> |
<script type="text/javascript"> |
function OnLogoChange(sender, eventArgs) |
{ |
var grid = $find("<%= RadGridComm.ClientID %>"); |
for (var i = 0; i < grid.get_masterTableView().get_selectedItems().length; i++) |
{ |
var Row = grid.get_masterTableView().get_selectedItems()[i]; |
var ID = grid.get_masterTableView().GetCellByColumnUniqueName(Row, "ID"); |
var oWindow = radopen("/Site/Usager/ChangePhoto.aspx?sUID=" + ID.innerText + "&sType=Logo", "ChangeLogo"); |
} |
} |
</script> |
</telerik:RadCodeBlock> |
All the best,
Iana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.