PDA

View Full Version : [CLOSED] How to pass extraparams tp directmethod?



feanor91
Apr 19, 2012, 1:35 PM
Hello

I choose to deal with my data update in code behind.

In 1.3 I use something like that:



<ext:Button ID="btnDelTemplate" runat="server" Text="Remove a template" Icon="Delete">
<DirectEvents>
<Click OnEvent="btnDelTemplate_Click">
<ExtraParams>
<ext:Parameter Name="data" Value="grdTemplate.getRowsValues({selectedOnly : true})" Mode="Raw" Encode="true"></ext:Parameter>
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>


to delete or like that (with a little update on the event type to work on 2.0):



<DirectEvents>
<ValidateEdit OnEvent="UpdateTemplate">
<ExtraParams>
<ext:Parameter Name="data" Value="r.data" Mode="raw" Encode="true" ></ext:Parameter>
</ExtraParams>
</ValidateEdit>
</DirectEvents>


to add.

But in 2.0, "getRowsValues" and "r.data" did not work. So what I have to use in place? I found nothing in example or changelog.

Daniil
Apr 19, 2012, 4:39 PM
Hi,

1. I think you should wrap grdTemplate" in #{}.

<ext:Parameter
Name="data"
Value="#{grdTemplate}.getRowsValues({selectedOnly : true})"
Mode="Raw"
Encode="true" />

It's related to the item #90:
http://examples2.ext.net/#/Getting_Started/Release_Documents/CHANGELOG/

2. I think you should use

e.record.data

<ext:Parameter
Name="data"
Value="e.record.data"
Mode="raw"
Encode="true">

See also
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.plugin.RowEditing-event-validateedit

feanor91
Apr 19, 2012, 5:00 PM
Thanks, I will try that