PDA

View Full Version : [CLOSED] Remote action refusal when moving a node



RCN
Jun 11, 2012, 12:00 PM
Hi Folks, i have a TreePanel where user is able to move nodes. I implemented it using http://examples2.ext.net/#/TreePanel/Advanced/Remote_Mode_with_Service/ as example. The difference between mine example and the mentioned one is that mine is implemented in MVC. In my case, i always get RemoteActionRefusal. Any idea to overcome this problem?




<ext:TreePanel ID="TreePanel1" runat="server" Title="Ext" Width="500"
Height="300" Collapsible="true" UseArrows="true" RootVisible="false" RemoteMoveUrl="/Example/MoveNode"
Mode="Remote" RemoteJson="true">
<View>
<ext:TreeView>
<Plugins>
<ext:TreeViewDragDrop runat="server" AllowLeafDrop="true" />
</Plugins>
</ext:TreeView>
</View>
<DirectEventConfig Method="POST" />
<Listeners>
<RemoteActionException Handler="alert('Exception')" />
<RemoteActionRefusal Handler="alerts('refused')" />
<RemoteActionSuccess Handler="alert('succeeded')" />
</Listeners>
<Fields>
<ext:ModelField Name="identifier" />
</Fields>
<SelectionSubmitConfig Encode="true" />
<ColumnModel>
<Columns>
<ext:TreeColumn ID="TreeColumn1" runat="server" Text="identifier" Flex="2" Sortable="true"
DataIndex="identifier" />
</Columns>
</ColumnModel>
<Root>
<ext:Node Icon="Folder" NodeID="1" Expanded="true">
<CustomAttributes>
<ext:ConfigItem Name="identifier" Value="1" Mode="Value" />
</CustomAttributes>
<Children>
<ext:Node Leaf="true" NodeID="2">
<CustomAttributes>
<ext:ConfigItem Name="identifier" Value="2" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true" NodeID="3">
<CustomAttributes>
<ext:ConfigItem Name="identifier" Value="3" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true" NodeID="4">
<CustomAttributes>
<ext:ConfigItem Name="identifier" Value="4" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true" NodeID="5">
<CustomAttributes>
<ext:ConfigItem Name="identifier" Value="5" Mode="Value" />
</CustomAttributes>
</ext:Node>
</Children>
</ext:Node>
</Root>
</ext:TreePanel>




public object MoveNode(string[] ids, string targetId, string point)
{
return new { actionSuccess = true };
}

Daniil
Jun 11, 2012, 2:04 PM
Hi,

Please use:

public ContentResult MoveNode(string[] ids, string targetId, string point)
{
object r = new { actionSuccess = true };
return Content(JSON.Serialize(r), "json/application");
}

Daniil
Jun 11, 2012, 8:07 PM
public ContentResult MoveNode(string[] ids, string targetId, string point)
{
object r = new { actionSuccess = true };
return Content(JSON.Serialize(r), "json/application");
}

It would be better to use

Ext.Net.RequestManager.SuppressAjaxRequestMarker() ;
return Content(JSON.Serialize(new { actionSuccess = true }));
for now.

We will think how to organize the things better.

RCN
Jun 12, 2012, 1:42 AM

Daniil
Jun 12, 2012, 10:15 AM
Well, thanks a lot for all your questions and suggestions. You really help to make Ext.NET better.

On our part we always happy to consider the members suggestions how to improve Ext.NET.

Sure, if we would consider some scenario should have some built-in Ext.NET options, we will implement it.

In that concrete case, we agree the things should be organized better. Maybe, we will create a separate type of action result, maybe something else.

We will notify you when we will come up with a solution.

RCN
Jun 12, 2012, 11:12 AM
Thank you Daniil, thumbs up to ext.net team :)

RCN
Jun 23, 2012, 7:06 PM
please mark it as closed.

Daniil
Jun 25, 2012, 12:27 PM
Hi @RCN,

Thanks for the update.

Though we would leave it unclosed, because we are still going to improve that, because it looks bad.

Ext.Net.RequestManager.SuppressAjaxRequestMarker() ;

return Content(JSON.Serialize(new { actionSuccess = true }));




When we will come up with any solution, we will update this thread sharing that solution and can mark it as closed with a clear conscience:)

Thanks again for all your questions, bug reports, enhancement suggestions on the forums.

Daniil
Jan 11, 2013, 5:42 AM
We have improved MVC support for TreePanel remote mode.
http://mvc.ext.net/#/TreePanel_Advanced/Remote_Mode/

RCN
Jan 11, 2013, 10:32 AM
Thank you Daniil