var sitename = ".."; function twdQuery(qconfig, gridHandler) { var result = []; this.queryAPI = function (config,paramIn, notifyWhenResoult) { var syn = false; // if (typeof (notifyWhenResoult) != "undefined") syn = true; $.ajax({ url: sitename + '/fmquery/' + config.p0 + '/' + config.p1 + '/' + config.cnd, dataType: 'json', data: qconfig, //crossDomain: true, async: syn }).success(function (data) { result.splice(0, result.length); result.push(data); if (typeof (gridHandler) != "undefined") gridHandler(data); if (typeof (notifyWhenResoult) != "undefined") notifyWhenResoult(data, paramIn); }); } this.getResult = function () { if (result.length == 0) return result; return result[0]; } } function twdQueryInfo(notifyWhenResoult) { var schema = []; this.queryInfoAPI = function (config) { $.ajax({ url: sitename + '/fmqueryinfo', dataType: 'json', //data:config, //crossDomain: true, async: false }).success(function (data) { //schema.splice(0, schema.length); schema.push(data); //debuggr; if (typeof (notifyWhenResoult) != "undefined") notifyWhenResoult(data); }); } this.getSchema = function () { if (schema.length == 0) return schema; return schema[0]; } this.queryInfoAPI(); } //-- function addressQuery(gridHandler) { var result = []; this.queryAPI = function (config, paramIn, notifyWhenResoult) { var syn = false; // if (typeof (notifyWhenResoult) != "undefined") syn = true; $.ajax({ url: sitename + '/fmquery/' + config.p0 + '/' + config.p1 + '/' + config.cnd, dataType: 'json', //data:config, //crossDomain: true, async: syn }).success(function (data) { result.splice(0, result.length); result.push(data); if (typeof (gridHandler) != "undefined") gridHandler(data); if (typeof (notifyWhenResoult) != "undefined") notifyWhenResoult(data, paramIn); }); } this.getResult = function () { if (result.length == 0) return result; return result[0]; } } function wonderQuery(gridHandler) { var result = []; this.queryAPI = function (config, paramIn, notifyWhenResoult) { var syn = false; // if (typeof (notifyWhenResoult) != "undefined") syn = true; $.ajax({ url: sitename + '/fmquery/' + config.p0 + '/' + config.p1 + '/' + config.cnd, dataType: 'json', //data:config, //crossDomain: true, async: syn }).success(function (data) { result.splice(0, result.length); result.push(data); if (typeof (gridHandler) != "undefined") gridHandler(data); if (typeof (notifyWhenResoult) != "undefined") notifyWhenResoult(data, paramIn); }); } this.getResult = function () { if (result.length == 0) return result; return result[0]; } }