Welcome Guest Search | Active Topics | Sign In | Register

ClientSideOnItemCommand versts ClientSideEndEdit Options
ITMA
Posted: Sunday, September 12, 2010 1:42:09 PM
Rank: Advanced Member
Groups: Member

Joined: 6/23/2010
Posts: 48
HI

I’m studying your interesting Grids that I’m also working on a solution to use them in.
Preferably I wish to use a grid client side. In your documentation it is said that it is possible to state e.g. ”grid.raiseItemCommandEvent(itemIndex,"UpdateGrid");” to trigger the “itemCommand” on serverside.

That is OK for me when applying it on a “CommandColumn” as below. No problem at all, works just superb.



function grid_item_command_handler(
grid, itemIndex, colIndex, commandName) {

var grid = eo_GetObject("Grid1");

if (commandName == "Deleting") {

if (itemIndex >= 0) {

grid.deleteItem(itemIndex);
}
}

grid.raiseItemCommandEvent(itemIndex, commandName);

}



My need is to have a postback after that I have made a selection in a dropdownlist to have correct values in the form interaction with the user loaded from database. Therefore i have used following snippet in “ClientSideEndEdit”, but nothing happens out over what happened before I implemented the “raiseItemCom…” statement.



function on_hoursvars_end_edit(cell) {
var dropDownBox = document.getElementById("ddlhoursvars");
var selectedIndex = dropDownBox.selectedIndex;
if (selectedIndex > 0) {

var mySelect1 = dropDownBox.options[selectedIndex].value;
return mySelect1

dropDownBox.raiseItemCommandEvent(itemIndex, "UpdateGrid");

}
return null;
}



As it says “possible to use almost wherever”, I realize of course that I might be “out of scope”. So, without asking for a solution, I humble wonder what I’ve misunderstood?


Best Regards,

ITMA

eo_support
Posted: Sunday, September 12, 2010 1:56:45 PM
Rank: Administration
Groups: Administration

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

ClientSideEndEdit occurs when the cell leaves edit mode. That usually occurs when user selects another cell, thus the current editing cell leaves edit mode (the drop down list disappears). This is not the same as just selecting another item from your drop down. You will need to handle that event on your select element directly.

Thanks
ITMA
Posted: Sunday, September 12, 2010 3:14:37 PM
Rank: Advanced Member
Groups: Member

Joined: 6/23/2010
Posts: 48
OK!!!

I see, interesting. Thank's for your reply, on a Sunday. Impressing indeed.


Best,

ITMA


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.