Need disabled checkbox in a cell in Grid

Hi,

In my application, i am using grid whose data is being populated in form of the XML on the server side and that XML is being passed to the dhtmlxGrid object so that it can be rendered in the grid. I am facing following issues:

  1. In my grid, i have a column which displays checkboxes. Now, I want to disable some of the checkboxes depending on some condition, so that user cannot change the checkbox state. I know there is the API setDisabled for doing this. But, i am sending the data of the table through XML. So, I want to know if there is any attribute in XML by setting which i can get my particular cells as disabled. OR any other way to get this behaviour.
  2. In my grid, i want to disable the pagination. So, is there any way to set the pagination property on the XML? OR, enablePagination() is the only way to do this?

Could you please let me know the solution/workaround to achieve these?

Regards,
Vibhav Agrawal
NOTE: I am using Dhtmlx 2.5 Pro version.

Hi,
I am also facing issue with the pagination API.

In my scenario, we are creating the dhxGrid object and enabling the pagination using the enablePaging() api. But for a few cases, we need to disable the pagination which we come to know only in the onXLE event. So, in the onXLE event method, we are trying to call:
dhxGrid.enablePaging(false);
OR
dhxGrid.enablePaging(false, 10, 5, “recInfoArea”, true);

But both the API calls are not able to hide the pagination toolbar.

Could you please let me know how to disable the pagination in my above scenario (ie, pagination toolbar is already loaded and i need to hide it).

Regards,
Vibhav Agrawal

  1. Please check this post viewtopic.php?f=2&t=14011
  2. You can call enablePaging() command from xml docs.dhtmlx.com/doku.php?id=dhtm … from_xml&s[]=configuration&s[]=xml

Could you please let me know how to disable the pagination in my above scenario
You can call enablePaging() method from xml and on some condition do not include it into xml

Hi,

Regarding item 1, the cell type “ro” is clearing checkbox display. We want to display the selected checkbox but it should be disabled so that user cannot change its value.

Could you please provide the solution for the above?

Regards,
Vibhav Agrawal

You can use the same code and “coro” eXCell type. setDisabled() method will work for select boxes also.

Hi,

Celltype coro does not display disabled check box.
We want to display disabled checkbox on particular criteria.

Could you please provide solution for this scenario?

Regards,
Snehal Ghute

Sorry for inconvenience.

If you want to display checked disabled checkbox you should do the following:

  1. Pass “1” as cell value:
<cell type="ch">1</cell>
  1. Disable cell with setDisabled(true) method:
mygrid.cellById(rowId,cellIndex).setDisabled(true);

Thanks Olga, awesome tip, I was able to get everything working :slight_smile: