Feature request

Oct 4, 2011 at 3:32 PM
Edited Oct 4, 2011 at 3:57 PM

Hello.
At first thank you a lot for your hard work.

I have 2 requests:

1)Have on helper all javascript events. Now i'm forced to set them in LoadComplete function (or in other parts)
2)Support for grid-subgrid instead of simple subgrid mode. (would be fantastic if there may be a infinite subgrid mode)

 

Thank you a lot for your support!

Coordinator
Oct 4, 2011 at 5:27 PM

Hi

Support for all events is planned for next release, "subgrid as grid" feature will be scheduled for one of feature releases.

Regards,
Tomasz Pęczek

Oct 4, 2011 at 5:47 PM

Thank you!
Meanwhile, have you a workaround to make grid as subgrid work with your lib? 

Coordinator
Oct 4, 2011 at 5:53 PM
Edited Oct 4, 2011 at 6:03 PM

The release which should contain most of events is planned for end of this week. After this release you will be able to workaround "subgid as grid" by using subGridRowExpanded event. I will post here link to sample which will show that workaround when the release will be ready.

Oct 4, 2011 at 6:15 PM

May be possible to have an anticipation?

I already catched the event using javascript (after load data is complete, i use setgridparam and set my event).
Inside i place a grid.GetHtml and GetJavascript, but do not know how to pass javascript parameter (row key) to the strong helper! 

Coordinator
Oct 4, 2011 at 6:41 PM

Well this will be a pretty nasty workaround, but you can do it like this:

var grid = new Lib.Web.Mvc.JQuery.JqGrid.JqGridHelper<jqGrid.Models.ProductFormattedViewModel>("products",
    ...
    url: Url.Action("Products") + "?id=' + rowId + '",
    ...
);

Which will result in following JavaScript:

$('#products').jqGrid({
    ...
    url: '/Home/Products?id=' + rowId +'',
    ...
});
Oct 4, 2011 at 7:05 PM

Damn, you're right.

I was too many involved in thinking using RouteValues and i completely forgot the simple and functional querystring!
Thank you a lot! 

Coordinator
Oct 4, 2011 at 7:32 PM

I'm glad I could help.

Oct 5, 2011 at 1:04 PM

Sorry if i broke you ball again, i got other problem.

Even if we have removed rowId problem, i do not know how to pass tableId to strong typed helper, since it's directly wrote into javascript and can't use variables.

Coordinator
Oct 5, 2011 at 2:54 PM

You can still go for same extremely nasty workaround:

var grid = new Lib.Web.Mvc.JQuery.JqGrid.JqGridHelper<jqGrid.Models.ProductFormattedViewModel>("' + subgridId + '_t",
    ...
    url: Url.Action("Products") + "?id=' + rowId + '",
    ...
);

Which should result in (can't test it right now but should work):

$('#' + subgridId + '_t').jqGrid({
    ...
    url: '/Home/Products?id=' + rowId +'',
    ...
});

Oct 7, 2011 at 8:58 AM

Works perfectly.
Continue to improve it.

Oct 12, 2011 at 3:03 PM

May be possibile to have a Hidden attribute, means there will be not jqgrid columns generated for that field?

Coordinator
Oct 13, 2011 at 6:28 AM
XVincentX wrote:

May be possibile to have a Hidden attribute, means there will be not jqgrid columns generated for that field?

Hi,

You already have that, jqGridHelper supports HiddenInput and ScaffoldColumn standard DataAnnotations. You can read more here:
http://tpeczek.blogspot.com/2011/03/jqgrid-and-aspnet-mvc-strongly-typed.html