[CLOSED] Remote action refusal when moving a node

  1. #1

    [CLOSED] Remote action refusal when moving a node

    Hi Folks, i have a TreePanel where user is able to move nodes. I implemented it using https://examples2.ext.net/#/TreePane..._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 };
    }
    Last edited by Daniil; Jan 11, 2013 at 5:42 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use:
    public ContentResult MoveNode(string[] ids, string targetId, string point)
    {
        object r = new { actionSuccess = true };
        return Content(JSON.Serialize(r), "json/application");
    }
  3. #3
    Quote Originally Posted by Daniil View Post
    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.
  4. #4
  5. #5
    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.
  6. #6
    Thank you Daniil, thumbs up to ext.net team :)
  7. #7
    please mark it as closed.
  8. #8
    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.
  9. #9
    We have improved MVC support for TreePanel remote mode.
    http://mvc.ext.net/#/TreePanel_Advanced/Remote_Mode/
  10. #10
    Thank you Daniil

Similar Threads

  1. Replies: 8
    Last Post: Jun 20, 2012, 6:48 PM
  2. [CLOSED] Remove moving a node VS loading targetĀ“s children.
    By RCN in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 14, 2012, 5:11 PM
  3. Replies: 16
    Last Post: Jul 19, 2011, 3:53 AM
  4. Adding a tree node using "Mode=Remote"
    By mattwoberts in forum 1.x Help
    Replies: 2
    Last Post: Jan 07, 2011, 3:10 PM
  5. Replies: 1
    Last Post: Nov 24, 2010, 3:04 PM

Posting Permissions