Opened 17 years ago
Closed 17 years ago
#958 closed New Feature (fixed)
Context menu - supporting parameters
Reported by: | Batalf | Owned by: | Alfonso Martínez de Lizarrondo |
---|---|---|---|
Priority: | Normal | Milestone: | FCKeditor 2.6 |
Component: | UI : Context Menu | Version: | |
Keywords: | Review+ | Cc: |
Description (last modified by )
I have searched for this feature, but haven't found it.
What we need is the support for passing parameters from context menu item. We have implemented a list of paragraph styles in the context menu
Style |--- Style 1 Style 2 Style 3 etc.
"Style 1", "Style 2" and "Style 3" will all call a function named "SetParagraphStyle". This function will assign the current <p> paragraph to a css class name. This class name is the param we need to send to this function.
I can't see that the AddItem method supports parameters.
Is this something that could be implemented? Or are there any workarounds?
Attachments (1)
Change History (7)
comment:1 Changed 17 years ago by
Keywords: | context menu parameters menu item removed |
---|---|
Priority: | High → Normal |
comment:2 Changed 17 years ago by
Description: | modified (diff) |
---|---|
Owner: | set to Alfonso Martínez de Lizarrondo |
comment:3 Changed 17 years ago by
Keywords: | Review? added |
---|
When I coded the integration of the spellchecker for WriteArea I did in fact create a repeated number of commands, but it would have been easier and better fix it in the core, so here's the patch.
It does allow to add a parameter that will be sent to the Execute method of the related command, quite easy but powerful.
What's new entry:
The AddItem method now has an additional fifth parameter "tag" that will be send to the Execute method of the command for that menu item, allowing a single command to be used for different menu items.
comment:4 Changed 17 years ago by
Keywords: | Review+ added; Review? removed |
---|
Can we change the parameter name to "customData". It's more generic, and "tag" sounds much like an MS thing ;)
Please include the above changelog on commit.
comment:5 Changed 17 years ago by
Milestone: | → FCKeditor 2.6 |
---|
You can create several commands (just one constructor and use several instances) and then set in each instance the parameter that you want when you are adding them to the context menu items.