开发者

I want to trigger the CRUD row Update operation in a javascript function for an Infragistics WebDataGrid

I have the following Infragistics WedDataGrid (version 2.9.2), and JavaScript function. The first column in the WedDataGrid is a checkbox in a templated field and the javascript function is called on the checkbox click event.

I want to trigger the CRUD row Update operation from within the javascript function on the row that was checked. What is the call I need to use? Or can you recommend another way of doing this? I don't want to trigger it on rowselection changed, just when the ch开发者_StackOverfloweckbox is checked.

the js:

 <script type="text/javascript"> 
 function  RowSelectedByCb(id) { 
 // trigger a row Update, but how?  } 
 </script>

the wdg:

   <ig:WebDataGrid ID="igWdgComments" StyleSetName="Harvest" runat="server"
              DataSourceID="odsSelectComments" AutoGenerateColumns="False" 
        DataKeyFields="DrugCommentPKey" AutoCRUD ="true"  EnableViewState ="False"> 
        <Columns>
           <ig:TemplateDataField Key="cbSelect" Width="30px"><Header Text=" " />
            <ItemTemplate>
              <asp:CheckBox ID="cbSelect" runat="server" onclick="RowSelectedByCb(this)" />
             </ItemTemplate>
           </ig:TemplateDataField>

Rest of the columns...

  <Behaviors>
    <ig:Activation Enabled="true" /> 
    <ig:RowSelectors RowNumbering="True" /> 
    <ig:Selection RowSelectType="Single" CellClickAction="Row" Enabled ="true"> 
    <SelectionClientEvents CellSelectionChanged="CellChanged" /> 
    </ig:Selection> 
     <ig:EditingCore > 
       <Behaviors> 
        <ig:CellEditing> 
          <CellEditingClientEvents EnteringEditMode="CellChanged" /> 
          <EditModeActions EnableOnActive="True" MouseClick="Single" EnableOnKeyPress="True" />
        </ig:CellEditing>
      </Behaviors>
     </ig:EditingCore>
   </Behaviors>

Other stuff...


If you would like the grid to automatically update its datasource, you'll need to add the EditingCore behavior to the grid's behaviors collection. Then you can call commit on that to have it go back.

var grid = $find("igWdgComments");

var editingCore = grid.get_behaviors().get_editingCore();

editingCore.commit();

You will want to handle the row updating server event in order for the postback to happen right away.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜