MVC3에서 slickgrid 쓰임새

Posted by RAY.D
2015. 4. 27. 14:03 Web/Slickgrid
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.




http://stackoverflow.com/questions/12863893/usage-of-slickgrid-in-mvc3-entity-framework


usage of slickgrid in MVC3 entity framework


I've never used slickgrid before but based on the example page slickgrid example the following may help get you in the right direction:

//Controller
public JsonResult GetSlickGridData()
{
        var slickGridData = db.SlickGridData.ToList();
        return Json(slickGridData, JsonRequestBehavior.AllowGet);
}

//View
var data = [];
$.getJSON("/Index/GetSlickGridData", function (items) {
data = items;
});
grid = new Slick.Grid("#myGrid", data, columns, options);

So the idea here would be to use the jquery getJSON method to call your controller and bring back the information and store it in data. Again I'm not too familiar with slickgrid so you may have to also convert 'items' above to a javascript array before assigning it to 'data'.