PDA

View Full Version : Right-click (context menu)


relgames
01-09-2006, 05:17 AM
I have written wrapper class for right-click menu.

So now we can use the next construction:
<contextmenu name="cm">
<contextmenuitem caption="item1" onclick="parent.parent.onClickHandler1()" name="cmi1"/>
<contextmenuitem caption="item2" onclick="parent.parent.onClickHandler2()" name="cmi2"/>
</contextmenu>

And modify it's caption, for example:
cm.cmi1.setAttribute("caption", "new caption");

An example class is attached. I hope that Laszlo developers will include something like this class into next Laszlo releazes.

Now we can use just contextmenu class and don't worry about which version of Laszlo is used (Laszlo 3.1 with ContextMenu API or Laszlo 3.2 beta withLzContextMenu API). If you are using Laszlo 3.1, just modify ContextMenu.lzx for old ContextMenu API.

bfagan
01-11-2006, 07:23 AM
You could sign up as a contributor and request to have your component put in the distribution's incubator.

relgames
01-13-2006, 04:48 AM
I don't have time to lern how can I become a contributor.
I just writen new version, now with Laszlo 3.1 support (tested with 3.1.1 version)

bigBADguy
04-30-2006, 02:38 AM
Amazing! Yours is the only code that made context menu work with Grid on v3.2


<canvas debug="true">

<include href="ContextMenu.lzx"/>

<dataset name="testDS">
<items>
<item name="Name 1" age="23"/>
<item name="Name 2" age="35"/>
</items>
</dataset>

<class name="myGridRow" extends="basegridrow">
<contextmenu name="cm">
<contextmenuitem caption="Item1" onclick="Debug.write(this)" />
<contextmenuitem caption="Item2" onclick="Debug.write(this.parent)" />
<contextmenuitem caption="Item3" onclick="Debug.write(this.parent.parent)" />
</contextmenu>
</class>

<grid datapath="testDS:/" contentdatapath="items/item" _rowclass="myGridRow" width="300" readonly="true">
</grid>

<simplelayout spacing="20"/>
</canvas>


Well, it is not perfect, i will try to hack it...

kaustub.vaidya
07-25-2006, 02:10 AM
Hi

New to this forum,

Can anybody help us knowing this --

How to add contextmenu to a node of a tree, I m facing some problem in doing that, also tried with the api provided by laszlo.......

bfagan
07-25-2006, 06:06 AM
Can you post thr code that you're having trouble with?

kaustub.vaidya
07-25-2006, 10:53 PM
hi,
here am sending the code where am getting a problem
regarding the right click option on the tree node.

thanks

zvi
09-16-2006, 05:00 AM
Hi relgames

Your little context menu library is great. Can we have permission to use it and if so under what terms? Or might you contribute it to Laszlo after all?

Thanks

Zvi

zvi
09-16-2006, 05:27 AM
Hmmm, I still cannot get context menus to work at all for a view which is not directly under the canvas - even with relgames nice library - any onw know what is going on?

bigBADguy
10-31-2006, 09:32 PM
finally...

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&postid=24983