Sigma Php Ajax framework, Ajax Components, GUI Builder
May 17, 2012, 01:22:13 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: how to make a sigma grid event  (Read 1043 times)
footballermahesh
Newbie
*
Posts: 3


View Profile
« on: July 09, 2009, 04:20:07 AM »

How To Make a handler function on the grid
my code is
gridOption={
            id : grid_id,
            container : div_id,
            loadURL : loadurl,
            saveURL : saveurl,
            width: width,
            height: height,
            dataset : dsOption ,
            columns : colsOption,
            pageSize:row_per_grid,
            toolbarContent : 'nav | reload | add save',
            pageSizeList : [5,10,15],
            reloadAfterSave:true
}

mygrid=new Sigma.Grid(gridOption);
Sigma.Util.onLoad( Sigma.Grid.render(mygrid) );


MY HANDLER IS

mygrid.onClickCell = function(e){
        alert('Clicked');
}
PLease Advice..
Thanks in Advance
Logged
imtiazm
Jr. Member
**
Posts: 6


View Profile
« Reply #1 on: July 09, 2009, 07:35:43 AM »

Please change your code as below:

gridOption={
            id : grid_id,
            container : div_id,
            loadURL : loadurl,
            saveURL : saveurl,
            width: width,
            height: height,
            dataset : dsOption ,
            columns : colsOption,
            pageSize:row_per_grid,
            toolbarContent : 'nav | reload | add save',
            pageSizeList : [5,10,15],
            reloadAfterSave:true,

           onClickCell  : function(value, record , cell, row,  colNO, rowNO,columnObj,grid){
                    alert(1);    // this is your function, you can aswell track rowNo, colNo, cell value, etc.. based on the funciton parameter
            }
}

mygrid=new Sigma.Grid(gridOption);
Sigma.Util.onLoad( Sigma.Grid.render(mygrid) );
Logged
footballermahesh
Newbie
*
Posts: 3


View Profile
« Reply #2 on: July 09, 2009, 09:59:07 PM »

BUt what i did is i created a common function for creating the sigma grid
and around 12 pages using the same function for creating grid,
i need my 4th page's action,ie when clik the grid i need a alert, .. so it is not possible to created the jandler inside the gridoption

#
gridOption={
#
   id : grid_id,
#
   container : div_id,
#
   loadURL : loadurl,
#
   saveURL : saveurl,
#
   width: width,
#
   height: height,
#
   dataset : dsOption ,
#
   columns : colsOption,
#
   pageSize:row_per_grid,
#
   toolbarContent : 'nav | reload | add save',
#
   pageSizeList : [5,10,15],
#
   reloadAfterSave:true
#
 
#
   onClickCell: function(value, record , cell, row, colNO, rowNO,columnObj,grid){
#
      alert('clicked the cell');
#
   }
#
 
#
}


i need  out side like this

gridOption={
            id : grid_id,
            container : div_id,
            loadURL : loadurl,
            saveURL : saveurl,
            width: width,
            height: height,
            dataset : dsOption ,
            columns : colsOption,
            pageSize:row_per_grid,
            toolbarContent : 'nav | reload | add save',
            pageSizeList : [5,10,15],
            reloadAfterSave:true
}

mygrid=new Sigma.Grid(gridOption);
Sigma.Util.onLoad( Sigma.Grid.render(mygrid) );

//NOW I NEE D ONE HANDLER  HERE
mygrid.onClickCell = function(e){
            alert('clicked the cell');
}


Logged
humi
Hero Member
*****
Posts: 284


View Profile
« Reply #3 on: July 13, 2009, 10:45:02 AM »

maybe:

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!