iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I would like to add a menu item to the ContextMenu consisting of the name of a view. The elements in that menu item will be the colums in the view.
What I would like is for the user to right-click anywhere in the document, select a view and a column, and have viewName.columnName inserted into the document at that precise place. Is this possible?
I have attached an example of the type of ContextMenu I am looking for.
Best Regards,Christian Luckow
You coud use the OnEditorContextMenu client side event handler for such scenario as detailed in WebTextEditor documentation on the article "How-to: Add Item in Context Menu"
Here is the snippet for your scenario:
function WebTextEditor1_OnEditorContextMenu(controlId, menuObj){ var items = menuObj.RootMenu.Items; if (items.GetNamedItem("vCustom") == null) { items.Add(new WebMenuSeparatorItem()); var vCustomItem = new WebMenuItem("vCustom", "vCustomer", null, OnClickItemContext) vCustomItem.Items.Add(new WebMenuItem("vcFirstName", "FirstName", null, OnClickItemContext)); vCustomItem.Items.Add(new WebMenuItem("vcLastName", "LastName", null, OnClickItemContext)); vCustomItem.Items.Add(new WebMenuItem("vcAddress", "Address", null, OnClickItemContext)); vCustomItem.Items.Add(new WebMenuItem("vcPhone", "Phone", null, OnClickItemContext)); items.Add(vCustomItem); }}function OnClickItemContext(menuItem){ var rte = ISGetObject("WebTextEditor1"); var keyword = { vcFirstName: "vCustomer.FirstName", vcLastName: "vCustomer.LastName", vcAddress: "vCustomer.Address", vcPhone: "vCustomer.Phone" }; setTimeout(function() { rte.SetValueToCurrentPosition(keyword[menuItem.Name]); }, 500);}
Hi Christian,
Forgive me, I am having a problem to understand your scenario. Could you kindly be more specific on this? For example, does it related to WebGrid? Do you want to have a context menu that can show a specific column name?
Perhaps, you wanted to have a context menu and sub context menu that the item is retrieved from particular column. You detail information would be appreciated and it can help me to support you with the right solution.
Thank you and have a nice day.
Best Regards,
Andi Santoso
Hi Andi,
Thank you for answering my question. The component I am using is the WebTextEditor. This is not related to the WebGrid component.
What I am trying to achieve is basically a mail merge, but without using the build-in mail merge functionality. I need to create a letter template where I can insert labels to be replaced by data from the database. These labels must have the format view.columnName, for instance vInvoice.FirstName. When the end-user opens the letter, the system will replace the labels with data from the database so that the end-user sees the final letter in the editor.
I already have the code to replace the label with the data from the database, as I am currently using this functionality with another editor, I just need to know how to insert the labels into the letter template using the context menu.
Regards,
Christian
Thank you for your solution, it works perfectly.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname