diff options
author | Stanislav-Wolski <stan@dhtmlx.com> | 2012-03-07 15:51:51 +0200 |
---|---|---|
committer | Stanislav-Wolski <stan@dhtmlx.com> | 2012-03-07 15:51:51 +0200 |
commit | 2413df85344f0d6f7d8da8179979557f0d78511d (patch) | |
tree | 8a3354b11325cd5a660e72b81601fad780d27c35 /codebase/data_connector.php | |
parent | 9999864a2490604e3579fbf74a77a2378bb06e09 (diff) | |
download | connector-php-2413df85344f0d6f7d8da8179979557f0d78511d.zip connector-php-2413df85344f0d6f7d8da8179979557f0d78511d.tar.gz connector-php-2413df85344f0d6f7d8da8179979557f0d78511d.tar.bz2 |
[update] support of dyn. loading for json connectors
Diffstat (limited to 'codebase/data_connector.php')
-rw-r--r-- | codebase/data_connector.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/codebase/data_connector.php b/codebase/data_connector.php index 042a20b..e6b5420 100644 --- a/codebase/data_connector.php +++ b/codebase/data_connector.php @@ -117,6 +117,9 @@ class DataConnector extends Connector{ parent::parse_request(); } + + if (isset($_GET["start"]) && isset($_GET["count"])) + $this->request->set_limit($_GET["start"],$_GET["count"]); } /*! renders self as xml, starting part @@ -138,6 +141,13 @@ class JSONDataConnector extends DataConnector{ $start = "[\n"; $end = substr($this->render_set($res),0,-2)."\n]"; + if ($this->dload){ + $start = "{ \"data\":".$start.$end; + if ($pos=$this->request->get_start()) + $end = ", \"pos\":".$pos." }"; + else + $end = ", \"pos\":0, \"total_count\":".$this->sql->get_size($this->request)." }"; + } $out = new OutputWriter($start, $end); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); |