Welcome Guest Search | Active Topics | Sign In | Register

Grid with Context menu inside a callback panel Options
Biju
Posted: Thursday, July 17, 2008 11:18:31 PM
Rank: Member
Groups: Member

Joined: 6/3/2008
Posts: 26
Hi,

1. How can I attach a context menu ( Add,Edit,Delete) to a Grid so that, by right clicking on a row, this menu will appear?
2. Can I display a particular row in edit mode while selecting the Edit option from Context menu?
3. Can I add a new row (Blank row) from client/server side while selecting Add option from Context menu?
4. Can I delete a particular row while selecting Delete option from Context menu?



eo_support
Posted: Friday, July 18, 2008 2:10:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

To your questions:

1. That's how context menu is used. Please see documentation for context menu for more details;
2. Yes. Use this function:
http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.Grid.editItem.html
3. You can add a row on the server side, but not on the client side. Simply create a new GridItem and add it to the Grid's Items collection;
4. Yes. Use this function:
http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.Grid.deleteItem.html

You may want to take a look of the document. It explained everything in great details.

Thanks
Biju
Posted: Friday, July 18, 2008 2:17:39 AM
Rank: Member
Groups: Member

Joined: 6/3/2008
Posts: 26
Thanks for your reply.

I had gone through the documentation of Context menu. But I can't find any code whcih explains, how the Context menu can be attached to the row of a grid. How I can attache the context menu to the clicked row.
eo_support
Posted: Friday, July 18, 2008 2:45:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

I think you attach the menu to the whole Grid instead of a single row. You would just use this function to get the current row when you need to:

http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.Grid.getSelectedItem.html

Thanks
Biju
Posted: Friday, July 18, 2008 4:47:07 AM
Rank: Member
Groups: Member

Joined: 6/3/2008
Posts: 26
How I can set the contextcontrolid property of the Context menu to the selecteditem of the grid? Whether I have to write javascript for displaying the contextmenu for a selected row in the grid?
Which client side event I can utilise for this purpose?
eo_support
Posted: Friday, July 18, 2008 4:56:06 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Biju wrote:
How I can set the contextcontrolid property of the Context menu to the selecteditem of the grid?


You don't. As explained above, The context menu is for the Grid, not for the Grid item. So you set ContextControlID to the ID of the Grid. Who triggers the context menu and who the context menu item operates on are two different things. For example, you right click anywhere on the Grid shows the context menu, but then when you click "Delete" from the context menu, it delete the current selected row. In this case, the Grid triggers the context menu, where "Delete" operates on the current row. The row is the target, but not the trigger. These are two separate issues, you seem to have confused them as one.

Currently the Grid does not change current selection when you right click. That might be something we need to address in our future builds.

Thanks
Biju
Posted: Friday, July 18, 2008 5:06:48 AM
Rank: Member
Groups: Member

Joined: 6/3/2008
Posts: 26
Thanks for your support
Now the context menu will be displayed when i right click anywhere in the grid. Actually, I am trying to Display the context menu only when I right click on a particular row.
eo_support
Posted: Friday, July 18, 2008 5:11:38 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Biju wrote:
Display the context menu only when I right click on a particular row.


That doesn't appear to be possible in the current version. We will look into it and see if we can add that.
Biju
Posted: Friday, July 18, 2008 5:21:57 AM
Rank: Member
Groups: Member

Joined: 6/3/2008
Posts: 26
Thanks for your support.
If you found any solution, then please let me know.
eo_support
Posted: Sunday, July 20, 2008 9:09:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

We have added a new ClientSideOnCntextMenu through which you will be able to display a context menu for a specific item. A new sample is also provided to demonstrate how to use this feature:

http://www.essentialobjects.com/Demo/Default.aspx?path=Grid\_i1\_i20

Thanks
Biju
Posted: Sunday, July 20, 2008 10:10:48 PM
Rank: Member
Groups: Member

Joined: 6/3/2008
Posts: 26
Thanks for your great support.

Biju
Posted: Wednesday, July 23, 2008 12:48:59 AM
Rank: Member
Groups: Member

Joined: 6/3/2008
Posts: 26
Hi,

I gone through the demo. Now, each item is editable with a single click and it will remain in edit mode even if that cell's focus is changed?
1. How I can display the grid initially as non editable?
2. How I can put a row/cell in non editable mode on its lost focus?
2. How I can use double click instead of single click for displaying a row in edit mode?
3. When I click on the Add New context menu, The grid will put the blank row which is already added to the grid in edit mode. suppose I never added any item in that row and click on some other row. Then one more row will be added to the grid since AllowNewItem is set to True. How I can avoid this kind of adding blank rows? ie, whether any client side event is available when a cell/row has lost it focus so that I can delete the row if that row is blank?
4. In a grid we can set the width either in pixels or as percentage. For aech column, we can set the width in pixels. But How we can set the width of each column by specifying its percentage?

Thanks
eo_support
Posted: Wednesday, July 23, 2008 1:39:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Biju wrote:

1. How I can display the grid initially as non editable?
2. How I can put a row/cell in non editable mode on its lost focus?
3. When I click on the Add New context menu, The grid will put the blank row which is already added to the grid in edit mode. suppose I never added any item in that row and click on some other row. Then one more row will be added to the grid since AllowNewItem is set to True. How I can avoid this kind of adding blank rows? ie, whether any client side event is available when a cell/row has lost it focus so that I can delete the row if that row is blank?


Please see the comment in the context menu sample for more details. The sample should provide information for:

1. How to enter/exit edit mode;
2. How Add New row works in the sample;

Biju wrote:

2. How I can use double click instead of single click for displaying a row in edit mode?


You will need to handle ondblclick event and put the Grid into edit mode by yoursef ---- please see answers to your previous questions as to how to put the Grid into edit mode.

Biju wrote:

4. In a grid we can set the width either in pixels or as percentage. For aech column, we can set the width in pixels. But How we can set the width of each column by specifying its percentage?


This not possible. You can set one column's Width to -1 to make the column an "AutoFill" column.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.