Author Topic: Select editor and hidden id column  (Read 3121 times)

jocavill

  • Newbie
  • *
  • Posts: 2
    • View Profile
Select editor and hidden id column
« on: November 20, 2015, 03:13:44 pm »

    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/themes/base/jquery-ui.css" />
    <link rel="stylesheet" href="/packages/ParamQuery/pqgrid.dev.css" />
    <!--<link rel="stylesheet" href="/packages/ParamQuery/themes/office/trax.css" />--->
    <div id="grid_custom_editing" style="margin:auto;"></div>
    <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
    <script src="/packages/ParamQuery/pqgrid.min.js"></script>
    <script type="text/javascript">
        $(function () {

            var data = [{
                ShipViaId: 'SE', ShipVia: 'Speedy Express'
            }];

            var colM = [
                { dataIndx: "ShipViaId", title: "Shipping Via ID", editable: false },
                { title: "Shipping Via", dataIndx: "ShipVia", width: 110,
                    editor: {
                        type: 'select',
                        valueIndx: "value",
                        labelIndx: "text",
                        options: [{"value": "", "text": ""}, {"value": "SE", "text": "Speedy Express" }, {"value": "UP", "text": "United Package" }, {"value": "FS", "text": "Federal Shipping"}] ,
                        mapIndices: { "text": "ShipVia", "value": "ShipViaId" }
                    },
                    validations: [{ type: 'minLen', value: 1, msg: "Required"}]
                }
            ];
            var dataModel = {
                dataType: "JSON",
                location: "local",
                data: data
            };
            $("div#grid_custom_editing").pqGrid({
                colModel: colM,
                dataModel: dataModel,
                editModel: {
                    saveKey: $.ui.keyCode.ENTER,
                    keyUpDown: false,
                    clicksToEdit: 1
                },
                historyModel: { checkEditable: false },
                numberCell: { show: false },
                resizable: true,
                scrollModel: { autoFit: true },
                selectionModel: { type: 'cell' },
                showBottom: false,
                title: "Shipping Orders <b>(Custom editing)</b>"
            });
        });

    </script>

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6265
    • View Profile
Re: Select editor and hidden id column
« Reply #1 on: November 20, 2015, 03:19:59 pm »
What's your question? If you mean to hide the id column, hidden property can be added to the id column.

Code: [Select]
{ dataIndx: "ShipViaId", title: "Shipping Via ID", editable: false, hidden: true },
« Last Edit: November 20, 2015, 03:36:37 pm by paramquery »

jocavill

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Select editor and hidden id column
« Reply #2 on: November 23, 2015, 02:30:44 pm »
Oh no - the question disappeared!

What I wanted to ask was with the given code snippet, I can't get the id column to automatically update like the demos. Is this just a pro feature?