Well, I'm falling for the jqGrid plugin for jQuery and trying to incorporate it in an ASP.NET MVC application. I have all the basic funcitonality working thanks to various blog posts from around the traps.
What I am trying to workout now is how to return data from the Controller in such a fashion as to populate select options on the edit form.
I know I just need to supply jqGrid with a URL to call to get back the options, but for the life of me I can't think (maybe too little coffee?) of how to render this from the Controller.
eg, the select list values can be hardcoded as "1:one;2:two", do I just need to return a json object in that form? Or a string?
Any help would be greatly appreciated.
Oops... the main problem I was having was trying to figure out what return type to put on the controller action. In the end it was so simple I couldn't see the wood for the trees. I ended up with a simple string output from the Controller action:
public string ObjectList()
{
// replace this with the code to construct your list values
return "1:one;2:two";
}
So simple it hurts to admit I missed it.