Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Nasir on Feb 24, 2009 05:22
open dhtmlx forum
Dataprocessor and Loadcsv

Hello,

I'd like to use the loadCSVString method to load CSV from a text area into a grid. I'd then like the check the data in the grid before sending it off to the server for saving with dataprocessor.

However, I am having a problem with dataprocessor as it doesn't seem to recognise the loaded data as 'changed', hence I don't get the bolding of the row when I load the data.

Is there some method I can trigger after the loadCSV to 'fool' dataprocessor into thinking the rows have changed and hence go bold (and then insert?)

Cheers and thanks,
Answer posted on Feb 24, 2009 09:27
You can call 
   dp.setUpdated(id,true); 
where dp - dataprocessor object

In your case it will be

grid.loadCSVString(...
grid.forEachRow(function(id){
   dp.setUpdated(id,true);
})

Answer posted by Nasir on Feb 24, 2009 15:21
Thanks for that - However I did need to modify the code slightly as it wouldn't update the freshly loaded data. I called this function:

 function load_data () {
       
            mygrid.loadCSVString(document.getElementById('ser_1').value);
           
            // called after data loaded into grid

            mygrid.forEachRow(function(id){
            myDataProcessor2.setUpdated(id,true); });
           
        }


And all works fine.

Cheers and thanks.