Want to fix some columns

耗尽温柔 提交于 2019-12-25 04:20:03

问题


I want to fix some columns so that user cannot drag and drop these columns and cannot reorder these columns also.Is it doable how can i do it.


回答1:


There is code inside grid.jqueryui.js that uses the jQuery UI Sortable Interaction to enable drag-and-drop columns.

The following selector determines which columns can be dragged-and-dropped:

"items": '>th:not(:has(#jqgh_'+tid+'_cb'+',#jqgh_'+tid+'_rn'+',#jqgh_'+tid+'_subgrid),:hidden)',

So basically the selector will choose any column header that is not hidden and does not satisfy one of the following criteria:

  • #jqgh_'+tid+'_cb' - A checkbox column (for multi-select)
  • #jqgh_'+tid+'_rn' - A row number column (for primary key?)
  • #jqgh_'+tid+'_subgrid - A subgrid column

To satisfy your request, jqGrid would have to be modified to populate the items selector with blacklisted columns. Maybe the blacklisted columns could be flagged using a new colmodel option. This is all do-able, but requires changes to jqGrid itself...



来源:https://stackoverflow.com/questions/9578273/want-to-fix-some-columns

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!