This is a migrated thread and some comments may be shown as answers.

Grid Update Client Site

3 Answers 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krzysztof
Top achievements
Rank 1
Krzysztof asked on 03 Oct 2008, 07:26 PM
Hi

In RadGridTag I have :
...
<ClientSettings>
 <ClientEvents OnCommand="Test"/>
 </ClientSettings>
</telerik:RadGrid>
...

and Test function look like :

function Test(sender, args)
      {
        var grid = $find("GridName");
       
        var MasterTable = grid.get_masterTableView();
        var row = MasterTable.get_dataItems()[args.get_commandArgument()];
        var cell = MasterTable.getCellByColumnUniqueName(row, "sim");
        alert(cell.innerHTML); 
      }

I would like get new value of "sim" field after I click 'update" button on client site editing window before update grid. Now I get old data ...
I need this becurse I would like to send new data to server (SOAP) before update database.

Regards
Krzysztof

3 Answers, 1 is accepted

Sort by
0
Vladimir
Top achievements
Rank 1
answered on 04 Oct 2008, 12:20 PM
0
Krzysztof
Top achievements
Rank 1
answered on 05 Oct 2008, 09:21 AM
Hi Vlad

Very interesting sample but it do not fix my problem.

In Your code I found :
....

<telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="65px" UniqueName="CommandColumn">
                        <ItemTemplate>
                            <asp:Button ID="EditButton" CssClass="Button EditButton" OnClientClick="toggleEditing(this, event); return false;"
                                runat="server" />
                            <asp:Button ID="UpdateButton" CssClass="Button UpdateButton" Style="display: none;"
                                OnClientClick="updateItem(this, event); return false;" runat="server" />
                            <asp:Button ID="CancelButton" CssClass="Button CancelButton" Style="display: none;"
                                OnClientClick="toggleEditing(this, event); return false;" runat="server" />
                        </ItemTemplate>

                      <HeaderStyle Width="65px"></HeaderStyle>
                    </telerik:GridTemplateColumn>
....

but I use PopUp editing style like :
...
<telerik:GridEditCommandColumn UpdateText="Update"  EditText="Edit" CancelText="Cancel">
<ItemStyle Width="30px" />                                     
</telerik:GridEditCommandColumn>
...
My question are :
How can I use Your JavaScript function in PopUp editing style ??
How can I call JavaScript function on Update and Cancel click in PopUp editing window (in Your code - OnClientClick="updateItem(this, event);) ??
How can I get new value of editing field in PopUp editing window after click update button ??

Regards
Krzysztof

0
Nikolay Rusev
Telerik team
answered on 07 Oct 2008, 07:06 AM
Hello Krzysztof,

Please find the attached project to this forum post.
It is an example of RadGrid client side editing in pop-up(RadWindow) form using client side templates.


All the best,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Krzysztof
Top achievements
Rank 1
Answers by
Vladimir
Top achievements
Rank 1
Krzysztof
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or