jQWidgets Forums

jQuery UI Widgets Forums Grid checkbox's indeterminate state

This topic contains 2 replies, has 2 voices, and was last updated by  Dimitar 11 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • checkbox's indeterminate state #50218

    viji
    Participant

    Hi,
    I want to disable $(‘#btn’) for indeterminate state in the below code (i.e, the third state of checkbox).

    $(“#jqxgrid.jqx-grid-column-header [role=’checkbox’]”).on(‘mousedown’, function (event) {
    if ($(“#jqxgrid.jqx-grid-column-header [role=’checkbox’]”).jqxCheckBox(‘checked’)) {
    $(‘#btn’).addClass(‘disabled’);
    }
    else {
    $(‘#btn’).removeClass(‘disabled’);
    }
    });
    Please let me know the possibilities.

    Thanks,
    Viji

    checkbox's indeterminate state #50274

    viji
    Participant

    Hi,
    Resolved the issue using rowscount.

    Thanks,
    Viji

    checkbox's indeterminate state #50275

    Dimitar
    Participant

    Hello Viji,

    Here is how to achieve this using your first approach:

    $("#jqxgrid").jqxGrid(
    {
        width: 670,
        height: 450,
        source: dataAdapter,
        sortable: true,
        filterable: true,
        ready: function () {
            $("#jqxgrid .jqx-grid-column-header .jqx-checkbox-default div:eq(0)").on('mousedown', function (event) {
                var state = $("#jqxgrid .jqx-grid-column-header [role='checkbox']").jqxCheckBox('checked');
                if (state == null) {
                    $("#jqxgrid .jqx-grid-column-header [role='checkbox']").jqxCheckBox('disable');
                } else {
                    $("#jqxgrid .jqx-grid-column-header [role='checkbox']").jqxCheckBox('enable');
                }
            });
        },
        selectionmode: 'checkbox',
        altrows: true,
        columns: [
            { text: 'Ship Name', datafield: 'ShipName', width: 250 },
            { text: 'Shipped Date', datafield: 'ShippedDate', width: 100, cellsformat: 'yyyy-MM-dd' },
            { text: 'Freight', datafield: 'Freight', width: 80, cellsformat: 'F2', cellsalign: 'right' },
            { text: 'Ship City', datafield: 'ShipCity', width: 100 },
            { text: 'Ship Country', datafield: 'ShipCountry' },
            { text: 'Ship Address', datafield: 'ShipAddress', width: 350 }
        ]
    });

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.