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
I am using the Minimal toolbar and want to remove the Insert from Web and Media Gallery buttons. How can I do this server-side?
Hi John,
You can remove the command from ToolBar in InitializeToolBar event. Here's the code:
protected void WebTextEditor1_InitializeToolBar1(object sender, WebTextEditorToolBarArgs e) { WebTextEditorToolBar tb = e.GetToolBarByCategory(WebTextEditorToolBarCategory.Standard); WebTextEditorToolCommand cmdInsertFromWeb = tb.ToolCommands.GetNamedItem("cmdInsertFromWeb"); WebTextEditorToolCommand cmdMediaGallery = tb.ToolCommands.GetNamedItem("cmdMediaGallery"); tb.ToolCommands.RemoveAt(2); tb.ToolCommands.Remove(cmdInsertFromWeb); tb.ToolCommands.Remove(cmdMediaGallery); }
Hope this helps.
Regards,Bernard
Hi Bernad,
That is the code I am using (converted to VB) but I get the following error at tb.ToolCommands.RemoveAt(2):
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
I changed it to tb.ToolsCommands.RemoveAt(0) and even tried tb.ToolsCommands.RemoveAt(1), it removed the buttons, but the editor was messed up and you ciouldn't enter any text.
I am using the ToolBarMode="Minimal", if I change it to ToolBarMode="Standard" then your code works, but then I would have to remove all other buttons not needed.
Attached is the page I am using.
Thanks
Dim tb As WebTextEditorToolBar tb = e.GetToolBarByCategory(WebTextEditorToolBarCategory.Standard) e.ToolBar.Remove(tb)
You can try that code and tell me if there's anything wrong in my code. Look forward to hear any feedback from you so I can help you further.
Hi Bernard,
The code you supplied does remove the items, but I do get a JS error which follows:
Line: 7 Error: 'ClientToolBar.1' is null or not an object
Line 7 is:
v3da31.ClientToolBar[1].Enable("cmdSpellChecker")
function WebTextEditor1_OnInitialize() { var WebTextEditor1 = ISGetObject("WebTextEditor"); document.getElementById("WebTextEditor1_tbStandard_f").style.visibility = "hidden"; return true; }
You can hide the toolbar from client side by using that code. Is this possible to use this code in your scenario? Look forward to hear any feedback from you so I can help you further.
I tried this code on client side and it doesn't work. I tried this on the sample that I uploaded in a previous message.
HI John,
Sorry for not explain it more detail for you. We must delete the server-side method to remove the toolBar first. I can use that code in your sample and it works. Here's the modified sample. Could you check my sample and tell me if there's any misconfiguration on that sample?
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