Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Kunal Bhatia on Jul 02, 2009 03:16
open dhtmlx forum
Regarding making rows disabled and enabled in .js files

Hello,
I want to make rows disabled when retrieving values from database and enabling rows only when "AddRow" button is clicked on adding a new row.Please help me where and what code i have to put ..

Thanks in advance
Answer posted by dhxSupport on Jul 02, 2009 03:37
To check if rows was loaded from the server you can use "onXLE" and "onXLS" events. Please check this article http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&q=948&ssr=yes&s=onXLS
Answer posted by Kunal Bhatia on Jul 02, 2009 03:43

 

I don't think this serves my purpose...

my area of concern is when i retrieve data from the database the column in the grid should be readOnly i.e the data should be readOnly...and after data is retrieved and then i click "AddRow" button to add new row to insert the new data...the column should now be editable so that i can enter some data in it.Please help me with dis..

Thanks in Advance

Answer posted by Support on Jul 02, 2009 05:20
a)
You can specify for all rows in xml
   <row readonly="true" ....

and add next line to the init

    grid.attachEvent("onRowCreated",function(id){
            if (this.getRowAttribute(id,"readonly")) this.lockRow(id);
    })

b) you can changed all columns to "ro" type, and set cells of new row as editable by using
        grid.setCellExcellType(...