8 Answers, 1 is accepted
Currently, this is not possible via the initial configuration. However, it is possible when using setDataSource method of the Sheet. Similar to the following:
spreadsheet = $(
sheet = spreadsheet.activeSheet();
Where would this code be placed on the page as I am having the same issue.
I tried the sheet.RequestEnd which works as you described when the page loads but as soon as I start to try and edit any of the cells in the spreadsheet the page freezes with a long running script error. If I comment out the code and just load the whole table everything works fine
The code in question should be executed at the point where it is appropriate to set the DataSource instance for your specific scenario. For example if you want to set the DataSource during initial loading you could use a document ready to do so.Regards,
Just to add about the approach you have tried. You should not use requestEnd to change the DataSource instance as this could result in an endless loop,. which I suspect is the behavior you are experiencing.Regards,
Rosen thanks for the quick reply. Would you have a quick example as I am having some issues with the document ready.
I have the datasource set in the sheet .Read command but am trying to limit the columns displayed. The trouble I seem to be having with the documentready is that the datasource is set at the .Sheet level and not the spreadsheet control level
Rosen I have gotten the document ready script to work so thank you for pointing me in the right direction. Now just having an issue when I try to update a date field in the spreadsheet but will open another ticket
I referred your above code while using setDataSource method. But the field column names looks static or fixed here. For me I have the column names generated dynamically and it may vary in number. I will have the field and title values but how can I use the loop to iterate through the variables to set the respective field and title values in above code?
Please let em know.
You could retrieve the dynamically generated columns by the following code:
sheet = $(
columns = sheet.dataSourceBinder.columns;
Check out the following Dojo example, where after the SpreadSheet data is bound, the columns of the sheet are being logged in the browser console. You should be able to then iterate over them and process them further depending on the project requirements.