1. That code gets the Query object from QueryPanel widget. Query object contains the internal query structure: list of columns, condition tree, etc. However in the latest version you can get Query object in a more simple way:
var query = EQ.client.getQuery();
2. This function sends a request to ExecuteSql action in sever-side EasyQuery controller or web-service. That action builds an SQL statement by the query object passed in request parameter in JSON format, then executes that SQL and returns the result set again in JSON. If you use the default implementation - then all you need to do is to derive your own class from EqDbMvcController and implement GetDataSetBySql() method.
3. Not sure if I unserstood your question correctly. That function makes jQuery ajax() call with type: "POST", dataType:"JSON".
Sorry this article is outdated. Here is the new "getting started" instructions for setting up EasyQuery in MVC: http://docs.korzh.com/easyquery/getting-started/getting-started-mvc
As for "on the fly" model binding - use this article: http://docs.korzh.com/easyquery/how-to/build-data-model-from-db
Discussion
1) in the last script can you please explain, what is the 4th line doing?
var query = QueryPanelBlock.QueryPanel('option', 'query');
2) How is this executing on serverside
function buildAndExecute() {
var QueryPanelBlock = $("#QueryPanel");
var query = QueryPanelBlock.QueryPanel('option', 'query');
EQ.client.buildAndExecute({
"query": query,
success: function (result) {
BuildQuerySuccess(result.statement);
ExecuteSQLSuccess(result.resultSet);
},
3) will this work with JSON, Ajax or POST
Query object contains the internal query structure: list of columns, condition tree, etc.
However in the latest version you can get Query object in a more simple way:
var query = EQ.client.getQuery();
2. This function sends a request to ExecuteSql action in sever-side EasyQuery controller or web-service.
That action builds an SQL statement by the query object passed in request parameter in JSON format, then executes that SQL and returns the result set again in JSON.
If you use the default implementation - then all you need to do is to derive your own class from EqDbMvcController and implement GetDataSetBySql() method.
3. Not sure if I unserstood your question correctly.
That function makes jQuery ajax() call with type: "POST", dataType:"JSON".
Here is the new "getting started" instructions for setting up EasyQuery in MVC:
http://docs.korzh.com/easyquery/getting-started/getting-started-mvc
As for "on the fly" model binding - use this article:
http://docs.korzh.com/easyquery/how-to/build-data-model-from-db