{"id":11,"date":"2007-08-04T19:00:12","date_gmt":"2007-08-04T16:00:12","guid":{"rendered":"http:\/\/www.trirand.com\/blog\/?p=11"},"modified":"2011-04-12T21:03:49","modified_gmt":"2011-04-12T18:03:49","slug":"jquery-grid-20","status":"publish","type":"post","link":"http:\/\/www.trirand.com\/blog\/?p=11","title":{"rendered":"jQuery Grid 2.0"},"content":{"rendered":"<p>I have made a decision to go direct to version 2.0, since this release has a lot of new features and bug fixes. Thanks to all that helped me to make this better. I will begin with a fixed bugs.<\/p>\n<ul>\n<li>IE and Safari hanging when some values in the xml node are empty &#8211; i.e. &lt;row&gt;&lt;\/row&gt;. Now I use a different approach &#8211; see the new features.<\/li>\n<li>IE does not format correct the table row if some data is empty &#8211; I analyze the data and add a space if it is empty.<\/li>\n<li>Sorting problem if we do not set sort property in the column model.<\/li>\n<li>Pager does not have correct navigation if we use a onSelectRow method and are on the first(last) page and clicking the first(last) or previous (next) page buttons.<\/li>\n<li>Now the Grid can read a xml file which is not returned from any server side language (thanks to Damian).<\/li>\n<\/ul>\n<p><!--more--><br \/>\n<strong>New features<\/strong><\/p>\n<ul>\n<li>The long awaited support for JSON data. See documentation for more details. In short &#8211; if we want to use a JSON there is a new option <em><strong>datatype<\/strong><\/em>. Set this option to &#8220;json&#8221; and enjoy. Default is &#8220;xml&#8221;.  In case of &#8220;json&#8221; the grid is much more faster.<\/li>\n<li>Improved is a speed of reading the xml data. The bug in IE (empty node value) force me not to use a firstChild.nodeValue (iteration of the xml tree), but a simple <em>text <\/em>(IE)  and <em>textContent<\/em> (Mozilla) property. This improved a speed in a big data sets.<\/li>\n<li>Now we can set a width of the grid (thanks to Luca). This is achieved with a new option <em><strong>width<\/strong><\/em>. How it works: If this option is not set, the width of the grid is a sum of the width&#8217;s of the columns defined in the column model + 20 pixels. If this option is set the width of each column is scaled according to the defined width. Example: if we define two columns with a width of 80 and 120 pixels, but want the grid to have  a 300 pixels &#8211; then the columns are recalculated as follow: 1- column = 300(new width)\/200(sum of all width)*80(column width) = 120 and 2 column = 300\/200*120 = 180. In the next release I will add a method setWidth which will change the width of the grid dynamically.<\/li>\n<li>Automatic height resizing. This is done with a new option <em><strong>rowheight<\/strong><\/em>.  This option defines the height of the single row (we must make some experiments here). If is set the height of the grid is changed according to the number of the returned rows from the server and the scroll bar does not appear. Important note here &#8211; if we want this to work we should not change the  property overflow hidden and white-space nowrap in the CSS .<\/li>\n<li>In the xml and JSON data formats I add a new tag &#8211; records. In this tag we can put the total records from the query. To view the total records from the query in the pager bar we should set the new option <em><strong>viewrecords<\/strong><\/em> to true. By default this option is false for backward compatibility. There is another option related to this &#8211; <em><strong>recordtext<\/strong><\/em>. This displays a text after the viewed records. The default value is in English and is: Record(s).<\/li>\n<li>I add another option &#8211; <em><strong>imgpath<\/strong><\/em>. Whit this option we can define the path to the images that are used from the grid. Define this without a &#8220;\/&#8221; at the end.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I have made a decision to go direct to version 2.0, since this release has a lot of new features and bug fixes. Thanks to all that helped me to make this better. I will begin with a fixed bugs. IE and Safari hanging when some values in the xml node are empty &#8211; i.e. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11"}],"collection":[{"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11"}],"version-history":[{"count":1,"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":797,"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions\/797"}],"wp:attachment":[{"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.trirand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}