TRI
TRI

Reputation: 21

Edit cell in slickgrid

I'm with problems trying to edit a cell in slickgrid. I'm still not familiar with slickgrid... I can normally put the data in the grid but I can't edit the cells value. I already set in my options the editable camp as true (editable:true), but still nothing happens when I try to edit. I guess I have to call something else to make the cell editable? Sorry if this question looks stupid, but indeed I'm still a "noob" with slickgrid. Below is my script where I initiate the grid

var grid;
var columns = [
                        { id: "Id", name: "Id", field: "Id" },
                        { id: "Name", name: "Name", field: "Name", minWidth: 70 },
                         { id: "Salary", name: "Salary", field: "Salary" },
                          { id: "Address", name: "Address", field: "Address" }

];

var options = {
    enableCellNavigation: true,
    enableColumnReorder: false,
    multiColumnSort: true,
    asyncEditorLoading: true,
    forceFitColumns: true,
    editable: true
};

$(function () {
    var myData = [];
    $.getJSON('/Home/getEmployeeList', function (data) {
        myData = data;
        console.log(myData);
        grid = new Slick.Grid("#myGrid", myData, columns, options);
    });
});

Upvotes: 1

Views: 3136

Answers (3)

Tetsuya
Tetsuya

Reputation: 83

I got similar issue and resolved it by including slick.editors.js.

<script src="slickgrid/slick.editors.js"></script>

Upvotes: 0

John
John

Reputation: 565

You have to add this

editor: Slick.Editors.Text,  
editor: Slick.Editors.LongText  
editor: Slick.Editors.Date  
editor: Slick.Editors.Checkbox

based on your requirement to a particular cell which needs to be edited

{ id: "Name", name: "Name", field: "Name", minWidth: 70, editor: Slick.Editors.Text},

Upvotes: 1

Ben McIntyre
Ben McIntyre

Reputation: 1968

The best place to start is the examples. You probably want this one: http://6pac.github.io/SlickGrid/examples/example3-editing.html

I'd advise you to use the 6pac repo, it's up to date. The original mleibman one has not been updated for about four years.

Upvotes: 0

Related Questions