Welcome Guest Search | Active Topics | Sign In | Register

OnItemCommand Options
Schneckmann
Posted: Wednesday, February 22, 2012 1:04:58 AM
Rank: Newbie
Groups: Member

Joined: 2/22/2012
Posts: 4
Hi,
I created a grid with apprx. 30 columns, db source is DataTable. Works fine. In column one I hold a field "itemnr" which is sourcefield for loading additional grids on page. So I´m using the OnItemCommand to send a postback to the server whilst clicking row/cell of grid (fullrow enabled as in false fullrow I cannot seem to send a postback. In my page that holds the grid (i.e. grid(s)) I added the script as listed in your example
function OnItemSelected(grid) {
var item = grid.getSelectedItem();
grid.raiseItemCommandEvent(item.getIndex(), "select");
}

Grid properties are: ClientSideOnItemSelected="OnItemSelected" OnItemCommand="GridMain_ItemCommand"

Now, everytime I click a row/cell my main grid holding the field "itemnr" seems to disappear for a while, i.e. seems to refresh or whatever. I find this extremely annoying as I "just" need the cell value on click of this grid. I do not need the grid to do anything else, just send it´s data. On debugging I get the impression "loosing" time on the local java script line var item = grid.getSelectedItem();. Am I using the wrong approach ? The whole intention of using this eo.web grid is its easy clickability, mine holds as many fields as I need those as well to populate a chart objects. Grid data is something like: ItemNr, Jan, Feb, Mar etc. I tried to fiddle around with the FullRow on false, i.e. just get cell value and send that to the server, but that does not seem to work. I tried something like the following to send the cell value to the server, but fails completely
function OnCellSelected(grid)
{
var cell = grid.getSelectedCell();
grid.raiseItemCommandEvent(cell.getValue(), "select");

}
So, my question basicly is: Am I using the right approach, or how can I get the main grid not to flicker around and stay calm on click. Is it because I am using so many fields ?
Schneckmann
Posted: Wednesday, February 22, 2012 1:59:32 AM
Rank: Newbie
Groups: Member

Joined: 2/22/2012
Posts: 4
Ah, I figured it out. I needed to put my additional grids, which receive data from first and main grid inside an update panel....


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.