jQuery UI Widgets Forums Grid Grid columntype problem

This topic contains 4 replies, has 2 voices, and was last updated by  Franco01 8 years, 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Grid columntype problem #79104

    Franco01
    Participant

    Hi!

    I use jQWidgets in my MVC 5 project, and in jqxgrid won’t appear columntype.
    I tried chechkbox, with bool column, and button.
    jQuery version is 1.11.1 like the Example.
    The datasource is Json.

    var source =
                    {
                        dataType: "json",
                        dataFields: [
                            { name: 'Teljesnev', type: 'string' },
                            { name: 'Telefonszam', type: 'string' },
                            { name: 'SzerepkorNev', type: 'string' },
                            { name: 'Email', type: 'string' },
                            { name: 'SzuletesiDatum', type: 'date' },
                            { name: 'Aktiv', type: 'boolean' }
                        ],
                        id: 'ProjektTagKod',
                        url: '/ProjektTag/ProjektTagLekerdezes/' + $("#Szerepkor").val() + '/' + $("#Teljesnev").val()
                    };
                    
                    var dataAdapter = new $.jqx.dataAdapter(source);
                    // create Tree Grid
                    //var editrow = -1;
                    $("#jqxgrid").jqxDataTable(
                    {
                        width: 920,
                        source: dataAdapter,
                        theme: 'darkblue',
                        //editable: true,
                        pageSize: 12,
                        sortable: true,
                        filterable: true,
                        pageable: true,
                        columns: [
                          { text: 'Teljesnév', columntype: 'textbox', dataField: 'Teljesnev', width: 160 },
                          { text: 'Telefonszám', dataField: 'Telefonszam', width: 120 },
                          { text: 'Szerepkör', dataField: 'SzerepkorNev', width: 120 },
                          { text: 'Email', dataField: 'Email', width: 220 },
                          { text: 'Születési dátum', dataField: 'SzuletesiDatum', width: 140, cellsformat: 'yyyy.MM.dd' },
                          { text: 'Aktiv', dataField: 'Aktiv', columntype: 'checkbox' },
                          {
                              text: 'Edit', datafield: 'Edit', columntype: 'button', cellsrenderer: function () {
                                  return "Edit";
                              }, buttonclick: function (row) {
                                  // open the popup window when the user clicks a button.
                                  editrow = row;
                                  var offset = $("#jqxgrid").offset();
                                  $("#popupWindow").jqxWindow({ position: { x: parseInt(offset.left) + 60, y: parseInt(offset.top) + 60 } });
                                  // get the clicked row's data and initialize the input fields.
                                  var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow);
                                  $("#Teljesnev").val(dataRecord.Teljesnev);
                                  $("#Telefonszam").val(dataRecord.Telefonszam);
                                  $("#SzerepkorNev").val(dataRecord.SzerepkorNev);
                                  $("#Email").val(dataRecord.Email);
                                  $("#SzuletesiDatum").val(dataRecord.SzuletesiDatum);
                                  // show the popup window.
                                  $("#popupWindow").jqxWindow('open');
                              }
                          }
                        ]
                    });

    In the grid I can see onlye true/false in the bool column, and edit label instead of button.

    Grid columntype problem #79107

    ivailo
    Participant

    Hi Franco01,

    Instead type: 'boolean' use type: ‘bool’.
    Also in you are not using jqx-all.js please check the references to jqxbuttons.js and jqxcheckbox.js

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Grid columntype problem #79111

    Franco01
    Participant

    Thanks.
    The first i was tried type: ‘bool’, and it does not work, so i tried boolean.
    And I use jqxbuttons.js and jqxcheckbox.js in the reference.

    Grid columntype problem #79112

    ivailo
    Participant

    Hi Franco01,

    Your code is similar to our popup editing demo so here is an example with localdata.
    Please check one more time the steps about integration of MVC5 with jQWidgets.
    If you are not with the latest version, please try to update.
    Also you can check the console for errors.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Grid columntype problem #79113

    Franco01
    Participant

    Thank you your answer.
    I checked it, and I don’t find the difference between the 2 codes.

    Everything is fine only the columntype attribute doesn’t work..

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

You must be logged in to reply to this topic.