Sigma Php Ajax framework, Ajax Components, GUI Builder
May 17, 2012, 01:46:26 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] 2
  Print  
Author Topic: Load a grid after the user input  (Read 8245 times)
sowritrpkkl
Jr. Member
**
Posts: 6


View Profile
« on: August 27, 2008, 10:24:17 PM »

Hi,

I want to load the grid after the user select a combo box value.

For example:

I have a month combobox, after selecting the month from the combobox depending upon the month selected the data should be displayed in the grid.

Please help me how to do this.
Logged
steven
Moderator
Hero Member
*****
Posts: 544



View Profile
« Reply #1 on: August 28, 2008, 09:01:48 AM »

That's easy.

Html code here


Javascript code here
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
sowritrpkkl
Jr. Member
**
Posts: 6


View Profile
« Reply #2 on: August 28, 2008, 09:50:49 PM »

Thanks a lot........
Logged
sowritrpkkl
Jr. Member
**
Posts: 6


View Profile
« Reply #3 on: September 19, 2008, 03:34:16 AM »

Hi,
The grid loaded perfect, but i want to change a "grid Options". like i need to hide save button and also i need to change some column as non editable. How to do this.
Kindly help me.
I am using the below code.

function loadData(){
    var grid=Sigma.$grid(grid1);
    grid.loadUrl = "../php/projectActivity.php;
var colsOptionNonEdit = [
        {id: 'account' , header: "Account" , width :120},
    {id: 'project' , header: "Project" , width :120},
    {id: 'manager' , header: "Manager" , width :150},
     
];
   grid.gridOptions = {
         showAddTool : false,
         columns : colsOptionNonEdit
      };

    grid.load();
}

but the grid options are not working.

Kindly do the needful
Logged
steven
Moderator
Hero Member
*****
Posts: 544



View Profile
« Reply #4 on: September 22, 2008, 02:22:34 AM »

That's easy. The following gridOption will show nav and pagesize only.
grid.gridOptions = {
         toolbarContent:  'nav | pagesize'.
         columns : colsOptionNonEdit
      };

'nav | pagesize | reload | add del save | print | filter chart | info' stand for all the buttons. You can hide some of them or change their order.
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
sks
Jr. Member
**
Posts: 5


View Profile
« Reply #5 on: December 18, 2008, 12:04:39 PM »

That's easy.

Html code here


Javascript code here


Sorry? but now it's not working! in v2.1!

We may use setContent:function(data).
loadUrl may use only like:
Logged
red4
Jr. Member
**
Posts: 13


View Profile
« Reply #6 on: March 20, 2009, 12:10:29 PM »

I need to do exactly as said in this post but I am not able to recover the
value of the input text might give me a hand? My loadURL:
Logged
pinkyto0o
Jr. Member
**
Posts: 12


View Profile
« Reply #7 on: March 22, 2009, 06:17:13 AM »

You can pass the value of the get variable using a parameter:
Quote
parameters : {name:"value"}
Logged
red4
Jr. Member
**
Posts: 13


View Profile
« Reply #8 on: March 23, 2009, 03:32:54 AM »

Ok but how create it? must receive the variable without page refresh, or need to come from a static combo

thanks

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


View Profile
« Reply #9 on: March 23, 2009, 04:56:35 AM »

If you need to pass a dynamic variable to the controller, do this as steven said:

Example of PHP in Grid.


Then in controller use the variable like this:


I don't know ASP so I cannot help with exact commands.

About the static combo:
http://www.sigmawidgets.com/products/sigma_grid2/docs/sigma_grid.html#addParameters
Something Like this maybe?
« Last Edit: March 23, 2009, 05:25:01 AM by humi » Logged
red4
Jr. Member
**
Posts: 13


View Profile
« Reply #10 on: March 23, 2009, 08:07:13 AM »

This last example that you have to be exactly what I need but when I road it does not work.   
Actually I need to get data from a combo fix and then have it filter the xml

thanks

My code:   
The function loadurl in loaddata not pass the parameters to loadurl in gridoption



   
If someone can help me I would be very grateful
« Last Edit: March 23, 2009, 09:36:40 AM by red4 » Logged
humi
Hero Member
*****
Posts: 284


View Profile
« Reply #11 on: March 23, 2009, 02:06:46 PM »



This looks better.
You will need to get the variables from the json array in the controller.

example in PHP:
Logged
red4
Jr. Member
**
Posts: 13


View Profile
« Reply #12 on: March 24, 2009, 04:08:24 AM »

Hi humi

Ok this is exactly what I need but I believe that has something wrong, you could check? Here I made a debug below:

Quote
Erro: missing ) after argument list
File Source: api/controler.php: 62, Coluna: 26
Source Code:
grid.addParameters("test":i, "inc":"port", "tab":"Vw_Vehicles");
Logged
humi
Hero Member
*****
Posts: 284


View Profile
« Reply #13 on: March 24, 2009, 04:13:40 AM »

My syntax was wrong. Sorry.

http://www.sigmawidgets.com/products/sigma_grid2/docs/sigma_grid.html#addParameters

Logged
red4
Jr. Member
**
Posts: 13


View Profile
« Reply #14 on: March 24, 2009, 04:23:09 AM »

Ok thanks

ok now he is working but ...   

What I understand is the following these parameters they are not passed within the variable below, note: The JSON recover it via get or post?

Quote
_gt_json   

{"recordType":"object","pageInfo":{"pageSize":10,"pageNum":1,"totalRowNum":200,"totalPageNum":20,"startRowNum"
:1,"endRowNum":10},"columnInfo":[{"id":"dt","header":"Data","fieldName":"dt","fieldIndex":"dt","sortOrder"
:null,"hidden":false,"exportable":true,"printable":true},{"id":"prefixo","header":"Prefixo","fieldName"
:"prefixo","fieldIndex":"prefixo","sortOrder":null,"hidden":false,"exportable":true,"printable":true
},{"id":"sentido","header":"Sentido","fieldName":"sentido","fieldIndex":"sentido","sortOrder":null,"hidden"
:false,"exportable":true,"printable":true}],"sortInfo":[],"filterInfo":[],"parameters":{},"action":"load"
}
Logged
Pages: [1] 2
  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!