Sigma Php Ajax framework, Ajax Components, GUI Builder
February 11, 2012, 08:05:28 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: Custom Editor For Grid as Modeldialog Box  (Read 1348 times)
anoopta
Jr. Member
**
Posts: 6


View Profile
« on: June 15, 2009, 04:45:23 AM »

In sigma Grid How to use a dialog box. When this dialog box is opened user must not do any action on the grid. so grid should be like disabled.

Can we use custom editors for this. Have anyone done this type of work.

I cannot use inline adding of grid bcz i have about 10 fields to be added. So how can i do this.

Here is the code i have tried.

humi,

  I tried the code but still some js error. Here is the code i am trying

var myDialogEditorCreater = new Sigma.DialogEditor({
      id: "myDialogEditor1",
      gridId : "memberGrid" ,
      width: 250,
      height:150 ,
      title : 'Customer',
      body : ['<input type="text" id="my_name_input" name="my_name_input"/><br/><br/>',
            '<input type="button" value="OK" onclick="Sigma.$grid(\'memberGrid\').activeDialog.confirm()"/>'].join(''),

      getValue : function(){
         return Sigma.$("my_name_input").value;
      },

      setValue : function(value){
         Sigma.$("my_name_input").value=value;
      },
      active : function(){
         Sigma.U.focus(Sigma.$("my_name_input"));
      }


   });

And i have a customized button to call this function


   Sigma.ToolFactroy.register(
   'career',
   {
      cls : 'career-cls',
      toolTip : 'Button Creation Example',
      action : function(event,grid) {

      myDialogEditorCreater.body();
   }
   }
     );


I am getting a error as
"myDialogEditorCreater.body is not a function"
"return not in function"

Can u help me to find the issue behind this error. I have around 10 fields to be displayed in this box and need to save it to database.
On submitting how i will get the data from the textbox.

Also on editing the same need to be filled in each text box and displayed in the dialog box.

How can i do this.
Logged
humi
Hero Member
*****
Posts: 284


View Profile
« Reply #1 on: June 15, 2009, 06:09:31 AM »

A Custom Dialog Editor will disable the grid until the Editor is closed.

Working Custom Dialog Editor for SigmaGrid 2.1
http://sigmawidgets.com/forum/ajax-data-grid-view/custom-data-editor-example/msg572/#msg572

myDialogEditorCreater.body();  --  is not a function of the Custom Dialog Editor. I don't know where you saw that.

How do you want to call the editor?

If you have 10 fields to edit: Are there more than 1 rows?
If there is more than 1 row, but the button in a column, and specify the dialog editor as the column editor.
Then you can modify row data with the editor.

http://sigmawidgets.com/forum/show-case/construction-company-project-managment/
When I click the first column of a row, the Custom Editor Dialog opens and lets me edit hidden columns in the row. I hope that clears it up a little.
Logged
anoopta
Jr. Member
**
Posts: 6


View Profile
« Reply #2 on: June 23, 2009, 01:38:19 PM »

Hi humi,

 Thanks for your reply.

  I have a Employee master with around 10 fields. But i am not showing the whole fileds in grid. Only First name, Last Name, Email, phone are displaying. I have 50 rows in the grid with paging as 10 rows per page. The last column of the grid have a edit button. And in the botton of the grid also have a add button to add these details. I want dialog editor bcz i want to make the grid disable when the dialog editor is opened. I am not using inline adding.

  What i need is on clicking the edit button image it should open a Dialog Editor printing all 10 fields data in the text box and on submit it should save and reload the grid.

  the dialog editor is opened when i give editor: myDialogEditorCreater in the image column.

  Now i need to know is how to display all the fields data in the text boxes. i am not getting it. plz help me


Also can we put a iframe like body : ['<iframe><textarea id="my_name_input" rows="3" cols="20" style="width:99%"></textarea></iframe>  in var myDialogEditorCreater = new Sigma.DialogEditor({ 

 i can`t see the textarea in the dialog editor when i use iframe.



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


View Profile
« Reply #3 on: June 25, 2009, 10:12:53 AM »

Sorry for delay.

What I use:
my dialog box:


my colsOption


my gridOption






WARNING: This is very sloppy.

You can probably see what you need form this working sample.


« Last Edit: June 25, 2009, 10:18:18 AM by humi » 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!