سؤال

I'm new at JQGrid. I can bind data to it via codebehind but i don't know how to bind from JQuery could you show me a source which i can learn how to do that ? Thank you

هل كانت مفيدة؟

المحلول

jqGrid have many features and it could be used in many different ways. So it's not enough that you write about a grid. You should specify more what you plan to do, which data you need to display, do you need only display or edit, search, filter, group and so on the data.

There are different strategy how you can provide the data to jqGrid. The most important to know at least approximately imagination about the data which you need to display. For example: do you have hierarchical data or you need just display flat table? Do you need show the user the data which have 30 rows and 5 columns or 100000 rows and 50 columns? Depend on the size of the data you can choose another strategy of the usage of jqGrid. For example one can implement server side paging, sorting and filtering/searching. Alternatively you can implement the same features on the client side. You can provide all data at once and use loadonce: true option. In the case you can write less code on the server side.

If you use for example SqlDataReader to access the data and you see tutorial using Entity Framework then you can not really use the code from such tutorial. Another example, you can provide data for jqGrid per Ajax and implement the server code as ASP.NET MVC controller action or as ASMX web service or as WCF service or as Web API or as ASHX hendler or ... I can continue. There are really many ways of writing ASP.NET code and I am not sure what you do (and what you have to do to corresponds the policy of your corporate). So it's really difficult to answer on your current question. It's too common.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top