1

I just downloaded jQuery Grid for ASP.NET MVC from codeplex

I did run the project, all seams to be all right, in Sql Profiler i can see that sql queries coming to database. Then in debugger i can see that data comes in LinqToSql query fine:

var model = from entity in repository.Index().OrderBy(sidx + " " + sord)
    select new
    {
        Edit = "_edit link was here_",
        Details = "_details link was here_",
        ProductID = entity.ProductID,
        ProductName = entity.ProductName,
        UnitPrice = entity.UnitPrice,
        Discontinued = entity.Discontinued == true 
            ? "<input type='checkbox' checked='checked' disabled='disabled'/>" 
            : "<input type='checkbox' disabled='disabled' />"
    };

Data coming to model, model is not null.

Then this data converting in to JSON and then JsonResult go in to view:

JsonResult jData = Json(model.ToJqGridData
    (page, rows, null, search, new[] { "ProductName" }));
return jData;

i saw in debugger, there is data in jData, jData is not null, all looking good.

But then on the view (html) there is no data displaying on the jqGrid, it is empty. For some reasons data not coming from controller to view(jqGrid). I was trying all latest browsers.

I think the problem hiding somewhere in javascripts, currently i am looking in to this.

May be some one have any ideas about that.

1
  • Yes, the problem is in your javascript. Commented Jul 14, 2010 at 8:50

2 Answers 2

1

You have to add 'JsonRequestBehavior.AllowGet' the following in JSonDataController, function List:

return Json(model.ToJqGridData(page, rows, null, "", 
            new[] { "ProductName", "UnitPrice" }), JsonRequestBehavior.AllowGet);
Sign up to request clarification or add additional context in comments.

Comments

0

It is not my javascript :) http://jqmvcgrid.codeplex.com/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.