In order for a change of options (such as disabling sorting) to take effect, currently you would have to draw it again, but if you want it sorted the same as it was, you would have to recreate that order somehow (either reorder your datatable, or invoke the same sorting actions on the table). So unfortunately, there is no way to do what I believe you are asking for, at least not in the Table chart functionality.
But you could probably override the click event handler that causes the sorting actions by the user, with suitable DOM manipulations. On Fri, May 5, 2017 at 8:20 PM, Weii Wang <[email protected]> wrote: > Hello, > > I have a table chart already drawn, but want to disable sorting after a > checkbox is checked. > Is there a method to change option after the table is ready. > > var SPRITE_table = new google.visualization.ChartWrapper({ > 'chartType': 'Table', > 'containerId': 'sprite_table', > 'options' : { > 'showRowNumber' : 'false', > 'allowHtml': 'true', > //'width': '2000', > 'cssClassNames': cssClassNames > }, > 'view': {'columns': [20,0,1,2,3,4,5,6,7,8,9,10,11]} > }); > google.visualization.events.addListener(SPRITE_table, 'ready', function > () { > * if($('#mycheckbox').is(':checked')){* > * // disable sorting for SPRITE_table* > * }* > )}; > > Thanks, > Weii > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to google-visualization-api@ > googlegroups.com. > Visit this group at https://groups.google.com/ > group/google-visualization-api. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/google-visualization-api/7ce33d0a-1266-44fe-9a3e- > 0da61ba4e492%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/7ce33d0a-1266-44fe-9a3e-0da61ba4e492%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge MA -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJNcC5U8%2BTmARufibg94vuaUXT92E_Nz_xu3Cjf7U--c-g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
