jQWidgets Forums

jQuery UI Widgets Forums Grid when click checkbox while disable particular cell in jqx column type 'checkbox'

This topic contains 5 replies, has 2 voices, and was last updated by  saud 10 years, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author

  • saud
    Participant

    Hi sir,

    when click checkbox while disable particular cell in jqx column type ‘checkbox’ . please send this code


    ivailo
    Participant

    Hi saud,

    Can you explain better what kind of functionality must be developed?

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com


    saud
    Participant

    hi sir,

    how to disable particular jqxgrid cell when change check box..
    thank you


    saud
    Participant

    Hi Ivailo ,
    I need disable particular jqxgrid cell. please send code


    ivailo
    Participant

    Hi saud,

    You can try this code.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <title id='Description'>This example shows how to show a checkbox column in the Grid plugin.
        </title>
        <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
        <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> 
        <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxnumberinput.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxgrid.edit.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script> 
        <script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsreorder.js"></script> 
        <script type="text/javascript" src="../../scripts/demos.js"></script>
        <script type="text/javascript" src="generatedata.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                // prepare the data
                var data = generatedata(200, true);
    
                var source =
                {
                    localdata: data,
                    datafields:
                    [
                        { name: 'firstname', type: 'string' },
                        { name: 'lastname', type: 'string' },
                        { name: 'productname', type: 'string' },
                        { name: 'available', type: 'bool' },
                        { name: 'quantity', type: 'number' },
                        { name: 'price', type: 'number' },
                        { name: 'total', type: 'number' }
                    ],
                    datatype: "array"
                };
                var dataAdapter = new $.jqx.dataAdapter(source);
    
                // initialize jqxGrid
                $("#jqxgrid").jqxGrid(
                {
                    width: 850,
                    source: dataAdapter,
                    editable: true,
                    columnsreorder: true,
                    editmode: 'selectedcell',
                    selectionmode: 'singlecell',
                    columns: [
                      {
                          text: 'First Name', editable: true, datafield: 'firstname', width: 120, cellbeginedit: function (row, datafield, columntype, value) {
                              var checked = $('#jqxgrid').jqxGrid('getcellvalue', row, 'available');
                              if (checked) return false;
                          }
                      },
                      {
                          text: 'Last Name', editable: true, datafield: 'lastname', width: 120
                      },
                      { text: 'Product', editable: false, datafield: 'productname', width: 180 },
                      {
                          text: 'Available', datafield: 'available', columntype: 'checkbox', width: 70
    
                      },
                      { text: 'Quantity', editable: false, datafield: 'quantity', width: 80, cellsalign: 'right' },
                      { text: 'Unit Price', editable: false, datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
                      { text: 'Total', editable: false, datafield: 'total', cellsalign: 'right', cellsformat: 'c2' }
                    ]
                });
    
            });
        </script>
    </head>
    <body class='default'>
        <div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
            <div id="jqxgrid">
            </div>
            <div style="font-size: 12px; font-family: Verdana, Geneva, 'DejaVu Sans', sans-serif; margin-top: 30px;">
                <div id="cellbegineditevent"></div>
                <div style="margin-top: 10px;" id="cellendeditevent"></div>
            </div>
         </div>
    </body>
    </html>

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com


    saud
    Participant

    Hi Ivailo ,

    Thank you Ivailo , I got it.

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

You must be logged in to reply to this topic.