jQWidgets Forums

jQuery UI Widgets Forums Grid Checkbox Column not editable

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 9 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Checkbox Column not editable #73495

    Claudio
    Participant

    Hi all,
    I am facing a problem regarding the checkbox column… they are not editable – even if I set editable: true.
    All other columns can be edited if I want to…
    Can somebody help me?

    Here is my code:

     var datafields = [
                    { name: 'Name', type: 'string' },
                    { name: 'Email', type: 'string' },
                    { name: 'Type', type: 'string' },
                    { name: 'AccountId', type: 'string'},
                    { name: 'ContactId', type: 'string'}
                ];
    
                var overviewSource =
                {
                    datatype: "json",
                    datafields: datafields,
                    localData: JSON.stringify(data),
                };
    
                var overviewDataAdapter = new $.jqx.dataAdapter(overviewSource,
                    {
                        loadComplete: function () {
                            //var length = dataAdapter.records.length;
                            $.each(overviewDataAdapter.records, function(i, v){
                                v.EmailToBeSent = false;
                                v.EmailSent = false;
                                v.Participated = false;
                            })
                        }
                    });
    
                $("#div").jqxGrid({ source: overviewDataAdapter });
                $("#div").jqxGrid(
                {
                    width: '100%',
                    editable: true,
                    autoheight: true,
                    ready: function () {
                        //$(TrainingsAppConstants.formAttendeesGridDiv).jqxGrid('autoresizecolumn', 'Email');
                        //$(TrainingsAppConstants.formAttendeesGridDiv).jqxGrid('autoresizecolumn', 'EmailToBeSent');
                        //$(TrainingsAppConstants.formAttendeesGridDiv).jqxGrid('autoresizecolumn', 'EmailSent');
                        //$(TrainingsAppConstants.formAttendeesGridDiv).jqxGrid('autoresizecolumn', 'Participated');
                    },
                    columns: [
                        { text: 'ID', datafield: 'ID', hidden:true, editable: false },
                        { text: 'AccountId', datafield: 'AccountId', hidden:false, editable: false },
                        { text: 'ContactId', datafield: 'ContactId', hidden:false, editable: false },
                        { text: 'Type', datafield: 'Type', cellsrenderer: typeRenderer, width: 20, editable: false },
                        { text: 'Name', datafield: 'Name' },
                        { text: 'Email', datafield: 'Email', editable: false},
                        { text: 'Email to be Sent', datafield: 'EmailToBeSent', threestatecheckbox: false, columntype: 'checkbox' },
                        { text: 'Email Sent', datafield: 'EmailSent', threestatecheckbox: false, columntype: 'checkbox' },
                        { text: 'Participated', datafield: 'Participated', threestatecheckbox: false, columntype: 'checkbox' },
                    ],
                    groupable: true,
                    groups: ['AccountId']
                });
    Checkbox Column not editable #73497

    Peter Stoev
    Keymaster

    Hi Claudio,

    Look at the Editing demos where there is CheckBox column which is editable. Apply the same approach to get the desired results. Another problem is that your data source does not have defined datafields for the checkbox columns.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Checkbox Column not editable #73500

    Claudio
    Participant

    Hi Peter,
    thanks for your quick response.

    I modified my datafields now like this:

    var datafields = [
                    { name: 'Name', type: 'string' },
                    { name: 'Email', type: 'string' },
                    { name: 'Type', type: 'string' },
                    { name: 'AccountId', type: 'string'},
                    { name: 'ContactId', type: 'string'},
                    { name: 'EmailToBeSent', type: 'bool'},
                    { name: 'EmailSent', type: 'bool'},
                    { name: 'Participated', type: 'bool'}
                ];

    Unfortunately it didn’t solve the problem.
    I’m also binding <script type="text/javascript" src="../Scripts/jqwidgets/jqx-all.js"></script> to make sure everything’s there.

    My problem was solved as I switched back to jQWidgets v3.8.0 (2015-Apr)…
    Could it be, that there is an issue in this build?

    Checkbox Column not editable #73501

    Peter Stoev
    Keymaster

    Hi Claudio,

    Taking the fact that it works in the online demos, it’s not an issue with the current build.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.