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

Append context menu option using the EditFormSettings Template

4 Answers 47 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 07 Nov 2011, 05:34 PM

I am trying to add an Append option to the context menu utilizing an Edit Form Template pop-up. The Insert option was easy since you had many examples. I tried, client side, to change the command to InitInsert with a currentIndex of -1 to indicate an Append operation, see below. When it runs, I do not get the Edit Form Template pop-up. I am also trying to incorporate the same functionality into Insert and Append buttons, separate from the Tree List control.

function CM_onClientItemClicked(sender, args) {

       var commandName = args.get_item().get_value();

       if (commandName == 'Append')

              _tlConfig.fireCommand('InitInsert', -1);

                else

              _tlConfig.fireCommand(commandName, currentIndex);

}

4 Answers, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 09 Nov 2011, 09:58 PM
I have gotten the Insert operation working from the context menu and buttons. I have not been able get an Append operation functional. I assume I need to file the InitInsert, but how do a pass an Append operation instead of an insert operation ?
0
Mira
Telerik team
answered on 10 Nov 2011, 10:14 AM
Hello Paul,

Could you please provide information on what you mean by the Append operation?
The RadTreeList provides option for firing custom commands, which you can handle in custom way. Please examine the Command Reference topic for additional information.

I hope this helps.

All the best,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Paul
Top achievements
Rank 1
answered on 10 Nov 2011, 02:08 PM

Hi Mira

 

By Append, I mean add a new item to the end of the TreeList. I have been trying to use the fireCommand with the InitInsert and make use of its second parameter. Since it was required but not used, I thought it would be passed with the command. If the second parameter is passed with the command, I haven’t found it. I could place a hidden textbox on the ASP page and set a code for Append versus Insert, but that’s a last resort.

0
Mira
Telerik team
answered on 15 Nov 2011, 08:45 AM
Hello Paul,

The position of the items in the RadTreeList depends on the order in which they come from the database.
The second argument of the fireCommand method comes as the e.CommandArgument in the ItemCommand event handler.
However, I am still unable to fully understand the difference between the InitInsert and Append commands in your scenario. If you need further assistance, please provide more information on them and I will do my best to help you.

Best wishes,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeList
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Mira
Telerik team
Share this question
or