1

明確ではないことは承知していますが、この画像を示します。

ここを見て

データ型を選択するときに、DB データ テキスト フィールドを次のように設定します。

データ型 – DB データ型

を。STRING - varchar(100)

b. INTEGER – 整数

c. LONG - Bigint

例えば ​​:

1)DB データ型テキストフィールドを varchar(100) または

2)DBデータ型テキストフィールドをintまたはintに設定できるように、データ型からINTEGERを選択すると

3)Data Type から LONG を選択すると、DB Datatype テキスト フィールドを Bigint に設定できます。

私のコードは次のとおりです。

$("#DataGrid").jsGrid({
                height: "100%",
                width: "70%",
                filtering: true,
                editing: true,
                inserting: true,
                sorting: true,
                paging: true,
                autoload: true,
                pageSize: 15,
                pageButtonCount: 5,
                datatype: "json",
                deleteConfirm: "Do you really want to delete the row?",
                controller: process_variables,
                fields: [
                    { name: "ID", align: "center", width: 10 },
                    { name: "Name", validate: { message: "Field Name is required", validator: function(message) { return message; } }, align: "center", type: "text", width: 100 },
                    { name: "Display Name", validate: { message: "Field Display Name is required", validator: function(message) { return message; } }, align: "center", type: "text", width: 100 },
                    { name: "Data Type", validate: { message: "Field Data Type is required", validator: function(value) { return value != ""; } }, align: "center", type: "select", items: process_variables.dataType, valueField: "Name", textField: "Name", width: 45 },
                    { name: "Initial Value", align: "center", type: "text", width: 40 },
                    { name: "Initial State", validate: { message: "Field Initial State is required", validator: function(value) { return value != ""; } }, align: "center", type: "select", items: process_variables.initialState, valueField: "Name", textField: "Name", width: 40 },
                    { name: "Worklist Order", align: "center", type: "number", width: 25 },
                    { name: "DB Datatype", validate: { message: "Field DB Datatype is required", validator: function(message) { return message; } }, align: "center", type: "text", width: 45 },
                    { name: "Allowed values", align: "center", type: "text", width: 100 },
                    { type: "control", width: 25 }
                ]

        });

これは私の js-GRID データベースです。

(function() {

    var total_data_ids = 8;
    var process_variables = {

        loadData: function(filter) {
            return $.grep(this.clients, function(client) {
                return (!filter.ID || client.ID.indexOf(filter.ID) > -1)
                    && (!filter.Name || client.Name.indexOf(filter.Name) > -1)
                    && (!filter.Displayed_name || client.Displayed_name.indexOf(filter.Displayed_name) > -1)
                    && (!filter.Data_type || client.Data_type === filter.Data_type)
                    && (!filter.Initial_value || client.Initial_value.indexOf(filter.Initial_value) > -1)
                    && (!filter.Initial_state || client.Initial_state === filter.Initial_state)
                    && (!filter.Worklist_order || client.Worklist_order === filter.Worklist_order)
                    && (!filter.process_variables_datatype || client.process_variables_datatype.indexOf(filter.process_variables_datatype) > -1)
                    && (!filter.Allowed_values || client.Allowed_values.indexOf(filter.Allowed_values) > -1);
            });
        },

        insertItem: function(insertingClient) {
            insertingClient.ID = total_data_ids;
            this.clients.push(insertingClient);
            $("#DataJson").html(JSON.stringify(this.clients));
            total_data_ids++;

        },

        updateItem: function(updatingClient) {
            $("#DataJson").html(JSON.stringify(this.clients));
        },

        deleteItem: function(deletingClient) {
            var clientIndex = $.inArray(deletingClient, this.clients);
            this.clients.splice(clientIndex, 1);
            $("#DataJson").html(JSON.stringify(this.clients));
        }

    };

    process_variables.dataType = [
        { Name: "STRING", Id: 0 },
        { Name: "INTEGER", Id: 1 },
        { Name: "DOUBLE", Id: 2 },
        { Name: "DATE", Id: 3 },
        { Name: "DATETIME", Id: 4 },
        { Name: "BOOLEAN", Id: 5 },
        { Name: "COMMENT", Id: 6 },
        { Name: "FILE", Id: 7 },
        { Name: "EMAIL_ADDRESS", Id: 8 },
        { Name: "AFM", Id: 9 },
        { Name: "ENTITY", Id: 10 },
        { Name: "LONG", Id: 11 }
    ];

    process_variables.initialState = [
        { Name: "HIDE", Id: 0 },
        { Name: "READ ONLY", Id: 1 },
        { Name: "WRITE", Id: 2 },
        { Name: "WRITE REQUIRED", Id: 3 }
    ];

    process_variables.clients = [];

    window.process_variables = process_variables;

}());
4

1 に答える 1