Here are two ways these two functions can be achieved on a dojox.grid.EnhancedGrid in a _Templated widget.
Disabling resize is quite easy to manage, when you know how. The column headers of a datagrid can be passed a noresize flag, which when set to true, inhibits this ability.
Simply define your column header as so:
<th field="id" width="50" noresize=true width="200"> ID </th>
Setting the width is optional, but any column without it will default to be 6em wide.
Preventing sorting is a little trickier. To do this I added the following code to the postCreate function of my widget to disable sorting on the fifth and sixth columns of my table (indexing starts at 1):
postCreate: function() { this.myGrid.canSort = function(col){ if(col === 5 || col === 6) { return false; } else { return true; }}; },
Amazing Article! Your informations like a charm. I have read 3 books on Android app development , nowhere I can find these instructions. Lots of thanks for this excellent tutorial. You saved my time hours. THANKS. Do you know about any Top mobile App Development companies in Dubai?
ReplyDeletePreparing for the Databricks-Certified-Data-Analyst-Associate - Databricks Certified Data Analyst Associate Exam? Discover top tips, study guides, and practical insights to boost your confidence and pass with flying colors. Start your journey today!
ReplyDelete