Sigma Php Ajax framework, Ajax Components, GUI Builder
February 09, 2012, 11:19:59 PM *
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: Calculated columns  (Read 2049 times)
anikitos
Jr. Member
**
Posts: 11


View Profile
« on: August 07, 2008, 01:19:23 PM »

Is it possible to have calculated columns in such way where user would edit one column and another would be affected in a predefined way?

Example: Distance, Speed, Time columns, where changing one would affect the other two. I understand that this can all be done by saving data and sending a request to server, but can it be done on the fly in client side? If so how?

Also, after the cell has been edited, is it possible to change the color until the save action?
And, is it possible to modify multiple cells at the same time in one column, or row? For example a user would highlight multiple cells, and edit with same value.
« Last Edit: August 07, 2008, 01:57:59 PM by anikitos » Logged
steven
Moderator
Hero Member
*****
Posts: 546



View Profile
« Reply #1 on: August 08, 2008, 01:51:38 AM »

Calculated columns is supported and you can see a sample at http://www.sigmawidgets.com/products/sigma_grid2/demos/example_formular.html.
After the cell has been modified, there will be a red marker at the top corner.
For row & column bulk editing, I think you need to do some scripts for that.  The following post may give you some idea about that.
« Last Edit: August 08, 2008, 02:22:49 AM by steven » Logged

Sigma AJAX Data Grid - Easy to Integrate with PHP, ASP Classic, ASP.NET & Java
Sigma PHP Ajax Framework - WYSIWYG GUI Builder With Tree, Grid, Treegrid, Dialog, Tab & More Component
steven
Moderator
Hero Member
*****
Posts: 546



View Profile
« Reply #2 on: August 08, 2008, 02:21:23 AM »

Logged

Sigma AJAX Data Grid - Easy to Integrate with PHP, ASP Classic, ASP.NET & Java
Sigma PHP Ajax Framework - WYSIWYG GUI Builder With Tree, Grid, Treegrid, Dialog, Tab & More Component
anikitos
Jr. Member
**
Posts: 11


View Profile
« Reply #3 on: August 08, 2008, 09:45:04 AM »

Thank you for your reply, Steven. 

I am looking through the example that you provided on the formulaic columns, and I am not understanding something, the script :  {id: 'bill_avg' , header: "Bill Avg",width :60, initValue : example_initAvg}, has a method example_initAvg which is defined to take as I understand  following parameters : a grid object (grid), row number (rn), and record, but the implementation does not use any of them, plus record is not used in the defenition.

I am confused about how to get the row number while defining colsOption, I see the getRowNumber in the gt_grid_all.js, but not sure how to use it. Also, how do I pass the grid object? Would it be mygrid defined as var mygrid=new Sigma.Grid( gridOption ); ?
Logged
steven
Moderator
Hero Member
*****
Posts: 546



View Profile
« Reply #4 on: August 10, 2008, 11:14:41 PM »

Do understand the following code?

Logged

Sigma AJAX Data Grid - Easy to Integrate with PHP, ASP Classic, ASP.NET & Java
Sigma PHP Ajax Framework - WYSIWYG GUI Builder With Tree, Grid, Treegrid, Dialog, Tab & More Component
anikitos
Jr. Member
**
Posts: 11


View Profile
« Reply #5 on: August 11, 2008, 07:41:15 AM »

 Shocked
Yes, I do understand the method. But I am lost on this:   
{id: 'bill_avg' , header: "Bill Avg",width :60, initValue : example_initAvg}, this is called in the definition of colsOption

example_initAvg is called without any parameters passed. I understand that this might be a mistatype, and it should be {id: 'bill_avg' , header: "Bill Avg",width :60, initValue : example_initAvg(grid, rn, record)}, if that is the case, how do i get the value of "rn", and "grid". Also why is there "record" in the parameter list, but not being used?

I am just trying to figure out if there is a mistype , or if I am misunderstanding something.

Thank you.
Logged
steven
Moderator
Hero Member
*****
Posts: 546



View Profile
« Reply #6 on: August 12, 2008, 07:36:52 PM »

You need not do that like this way.

If you look into JavaScript, you will notice that initValue is a callback function. You never call it by yourself. Instead, grid will call it at appropriate time. So the parameters are passed into by grid, not you.
Logged

Sigma AJAX Data Grid - Easy to Integrate with PHP, ASP Classic, ASP.NET & Java
Sigma PHP Ajax Framework - WYSIWYG GUI Builder With Tree, Grid, Treegrid, Dialog, Tab & More Component
anikitos
Jr. Member
**
Posts: 11


View Profile
« Reply #7 on: August 13, 2008, 08:18:59 AM »

Thank you, this makes sense. And it works. Grin
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!