volosoft / jtable

A JQuery plugin to create AJAX based CRUD tables.
http://www.jtable.org
1.1k stars 506 forks source link

JTable Pagination issue in asp.net MVC #1710

Open PawanToshniwal opened 9 years ago

PawanToshniwal commented 9 years ago

When i set pagination to true i need to pass jtStartIndex, jtPageSize. If i want to pass one more parameter of type string then how can we do that? Please share some sample to solve above issue.

peterboccia commented 9 years ago

I don't understand the real question, but if I god it, you are asking how to pass more than those parameter for the pagination. The method will be as the following one:

public JsonResult GetAll(string parameter1, int jtStartIndex = 0,
 int jtPageSize = 0, string jtSorting = null)

you can set the default value to those variables so you can add all your parameters. Then you can check if the pagination is supported by checking the jtPageSize (it cannot be 0).

PawanToshniwal commented 9 years ago

Thanks a lot peterboccia

PawanToshniwal commented 9 years ago

I made a very simple mistake Instead of below line listAction: '@Url.Action("GetJson","Home",new { name = "ArticleNo1" })' i called listAction: '@Url.Action("GetJson","Home","ArticleNo1" )'

peterboccia commented 9 years ago

Remember you can simply pass the parameter on load:

$('#youID').jtable('load', { name: 'ArticleNo1' });

And you avoid to left the complete URL in the listAction