Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






jqGrid 3.6 beta
Read original blog post

UserPost

09:52
23/10/2009


Pete

Member

posts 99

Mark or Tony,

How do you pull from the jqgrid36 branch of at Github?  Since the download is a little old, I'd like to just pull and merge everything from Github.  However, I don't know git commands.  It looks like "clone" is pulling from Master which I think is the 3.5 version.  I'd like to get the 3.6 "latest" .


Any pointers on using git? I have searched the web for hours but the git commands suggested don't seem to work.  This should be simple but I can't seem to get the latest 3.6 version to pull. What command should I use?

Thanks,

Pete


10:39
23/10/2009


Michael Greene

Guest


git clone

 was the correct command, but after you've cloned the repository this way, you should


git branch jqgrid36

to switch to the 3.6 branch

14:25
23/10/2009


fuhrysteve

Member

posts 12

Post edited 19:26 – 23/10/2009 by fuhrysteve
Post edited 19:29 – 23/10/2009 by fuhrysteve


This may or may not affect other stuff (looks like it's a temp variable, so maybe not it's all inside a function so it shouldn't matter), but I've been playing around the source and found a potential semantic error something that may cause problems in the future:

var childern

should probably be:

var children

at this location:

http://github.com/tonytomov/jq…..id.js#L142


This is misspelled on lines 142, 144, 157, & 158

15:10
23/10/2009


Pete

Member

posts 99

Michael Greene said:


git clone

 was the correct command, but after you've cloned the repository this way, you should


git branch jqgrid36

to switch to the 3.6 branch


I must still be doing something wrong (I am running the Windows version of git, BTW)  If I first run:

git clone git://github.com/tonytomov/jqGrid.git

and then run

git branch jqgrid

Is there something else I need to do? 

When I take a look at grid.base.js I still see the 3.5.3 version marker and just about everything else looks the same.  Is there any way I can tell I have the complete and correct release? I just hate to go through all the hassle and update and find out I have the same stuff.

Thanks

Pete

16:53
23/10/2009


markw65

Member

posts 179

Hi pete,


After the clone try this:


git checkout -b jqgrid36 origin/jqgrid36

git pull origin jqgrid36


After that, whenever you want to get the latest, just repeat the pull command.


Mark

15:58
24/10/2009


Pete

Member

posts 99

Post edited 21:03 – 24/10/2009 by Pete


Thanks Mark

The key was changing to the jqgrid folder after the clone but before running your two commands.  Once I did that it seemed to work.  I see the 3.6 versioning in grid.base.js now.

Pete


02:15
26/10/2009


jayarjo

Member

posts 17

Is it possible to drag rows to a connected div, instead of table?

10:23
26/10/2009


Adrian

Guest

Hy, I'm using the custom search module. With the new api I set it ike this 

jQuery("#grid").jqGrid('filterGrid',"#search",{
            gridModel:true,
            autosearch:true
        });

the error that commes is: "Could not get grid colModel". Can you confirme that is a bug? when will be the next stable release?

15:26
26/10/2009


Ed Valentine

Member

posts 32

I am trying the demo of 3.6 and getting the following in Firebug:


uncaught exception: [Exception... "Could not convert JavaScript argument arg 0" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: file:///E:/tgnew/sensadata/sensadata/jqgrid-36b/js/jquery.js :: anonymous :: line 12" data: no]


I am connecting to a MySQL database on another machine on the local network. The data is accessable from another tool.


Any suggestions?

10:56
27/10/2009


Sumit Arora

Guest


Hi Tony,


First of all, congratulations on the new release.


I have been using jqgrid 3.4.1 in my project. The way I designed the project is as follows:

1. Get all data as an XML string at once

2. Load into multiple grid on the same UI


So, I used the local datatype:

datatype: 'xmlstring'


Since, the data became huge with time, the performance deteriorated. And since, there was no pagination support for local datatype, I decided to add one. I hope you find this useful and it can be easily added into jqGrid 3.6 with some simple changes. Since I did not have a chance to look at jqGrid versions post 3.4.1, I am providing the changes I made in 3.4.1 to support simple pagination that worked for me.


Here are the changes I made (highlighted in bold):

1. Added, following grid parameters to each grid where pagination was to be supported:

pagination: {startIndex: 0, maxRecordsPerPage: 10}

2. Updated function addXmlData in grid.base.js


var addXmlData = function addXmlData (xml,t, rcnt) {

if(xml) { var fpos = ts.p.treeANode || 0; rcnt=rcnt ||0; if(fpos===0 && rcnt===0) {$("tbody tr:gt(0)", t).remove();} } else { return; }

var v,row,gi=0,si=0,cbid,idn, getId,f=[],rd =[],cn=(ts.p.altRows === true) ? 'alt':'';

if(!ts.p.xmlReader.repeatitems) {f = reader("xml");}

if( ts.p.keyIndex===false) {

idn = ts.p.xmlReader.id;

if( idn.indexOf("[") === -1 ) {

getId = function( trow, k) {return $(idn,trow).text() || k;};

}

else {

getId = function( trow, k) {return trow.getAttribute(idn.replace(/[\[\]]/g,"")) || k;};

}

} else {

getId = function(trow) { return (f.length – 1 >= ts.p.keyIndex) ? $(f[ts.p.keyIndex],trow).text() : $(ts.p.xmlReader.cell+":eq("+ts.p.keyIndex+")",trow).text(); };

}

$(ts.p.xmlReader.page,xml).each(function() {ts.p.page = this.textContent  || this.text ; });

$(ts.p.xmlReader.total,xml).each(function() {ts.p.lastpage = this.textContent  || this.text ; }  );

$(ts.p.xmlReader.records,xml).each(function() {ts.p.records = this.textContent  || this.text ; }  );

$(ts.p.xmlReader.userdata,xml).each(function() {ts.p.userData[this.getAttribute("name")]=this.textContent || this.text;});

$(ts.p.xmlReader.root+" "+ts.p.xmlReader.row,xml).each( function( j ) {

if(typeof ts.p.pagination != "undefined") {

   if(j<ts.p.pagination.startIndex) return true;

   if(j>=(ts.p.pagination.startIndex + ts.p.pagination.maxRecordsPerPage)) return false;

}

row = document.createElement("tr");

row.id = getId(this,j+1);


if(ts.p.multiselect) {

addMulti(t,row);

gi = 1;

}

if (ts.p.subGrid) {

try {$(ts).addSubGrid(t,row,gi,this);} catch (e){}

si= 1;

}

if(ts.p.xmlReader.repeatitems===true){

$(ts.p.xmlReader.cell,this).each( function (i) {

v = this.textContent || this.text;

addCell(t,row,v,i+gi+si, 'false');

rd[ts.p.colModel[i+gi+si].name] = v;

});

} else {

for(var i = 0; i < f.length;i++) {        

v = $(f[i],this).text();

changed = $(f[i],this).attribute();

addCell(t, row, v , i+gi+si,changed);

rd[ts.p.colModel[i+gi+si].name] = v;

}

}


if(j%2 == 1) {row.className = cn;} $(row).addClass("jqgrow");

if( ts.p.treeGrid === true) {

try {$(ts).setTreeNode(rd,row);} catch (e) {}

}


if(typeof ts.p.pagination != "undefined") {

   $(ts.rows[Math.abs(ts.p.pagination.startIndex - j)+fpos+rcnt]).after(row);

} else {

   $(ts.rows[(j)+fpos+rcnt]).after(row);

}


if(afterInsRow) {ts.p.afterInsertRow(row.id,rd,this);}

rd=[];

});

xml = null;

if(isSafari || isOpera) {resizeFirstRow(t,1);}

  if(!ts.p.treeGrid && !ts.p.scroll) {ts.grid.bDiv.scrollTop = 0;}

endReq();

updatepager();

};


3. Added two functions in grid.custom.js

showPreviousPage: function() {

       $t = this[0];

       if ( !$t.grid ) { return; }

       if ($t.p.pagination.startIndex >= $t.p.pagination.maxRecordsPerPage) {

           $t.p.pagination.startIndex = $t.p.pagination.startIndex – $t.p.pagination.maxRecordsPerPage;

       }

       else {

          $t.p.pagination.startIndex = 0;

       }

       $($t).trigger('reloadGrid');

},

showNextPage: function() {

       $t = this[0];

       if ( !$t.grid ) { return; }

       $t.p.pagination.startIndex = $t.p.pagination.startIndex + $t.p.pagination.maxRecordsPerPage;

       $($t).trigger('reloadGrid');

}


4. Added the following to show pagination controls for each grid.

$("#t_SampleGrid").append("<input type='image' id='showPreviousPage' src='off-prev.gif' title='Previous' onClick= 'jQuery(\"#SampleGrid\").showPreviousPage();'>");

 

$("#t_SampleGrid").append("<input type='image' id='showNextPage' src='off-next.gif' title='Next' onClick= 'jQuery(\"#SampleGrid\").showNextPage();'>");

Regards

Sumit Arora


06:39
28/10/2009


csitol

NC

Member

posts 13

Resize Grid!!!!

Thank you, thank you, thank you!!!

Yes, I know we could've written it ourselves, but for someone who's new to the plug-in this is a great help!  Excellent addition to jQuery.  Thank you so much for your work in making our lives much easier!

Phil Mickelson


06:52
28/10/2009


jmav

Member

posts 34

Can we get sample of Resize function,

02:45
29/10/2009


tony

Sofia, Bulgaria

Moderator

posts 7001

Hello

@Sumit Arora – Thank you very much. This work will be in the future 3.7 release. Of course we should adapt it to all datatypes.

@jayarjo – I think yes, we can drag a row to where we want. The method is fully customizable and uses jQuery UI widges draggable and droppable, so you can change all these parameters to meet your needs.

@Adrian – check your configuration and code again. The entrie demo for 3.6 works with the new API.

@jmav – the sample is in the demo and today I will update all the needed demo files, so you can use the method.


Best Regards

Tony

11:26
29/10/2009


Boris

Guest

Post edited 16:28 – 29/10/2009 by Boris
Post edited 16:29 – 29/10/2009 by Boris
Post edited 16:30 – 29/10/2009 by Boris
Post edited 16:31 – 29/10/2009 by Boris
Post edited 16:35 – 29/10/2009 by Boris


I downloaded jqGrid 3.6 beta and trying it on simple example

but it dosen't worksFrown

i have this error  $.jgrid.format is not a function

this is my code:


jQuery("#newapi").jqGrid({
url:"/resources/res_data/profession",
mtype: 'POST',
datatype: "json",
colNames:['Наименование', 'Код'],
colModel :[
 {name:'name', index:'name', width:110},
 {name:'code',index:'code',width:110}
 ],
rowNum:10,
rowList:[10,20,30],
pager: '#pnewapi',
sortname: 'name',
viewrecords: true,
sortorder: "desc",
caption:"New API Example" });
 jQuery("#newapi").jqGrid('navGrid','#pnewapi',{edit:false,add:false,del:false});
I using FF 3.5 on Ubuntu 9.10

Please tell me, what wrong hear

14:16
29/10/2009


tony

Sofia, Bulgaria

Moderator

posts 7001

Hello,

http://www.trirand.com/jqgridw…..to_install

17:38
29/10/2009


jmav

Member

posts 34

If you want to download latest jQgrid with all fixes use url:

http://github.com/tonytomov/jq…..s/jqgrid36

18:44
29/10/2009


Mark C

Guest

Used the load on scroll feature with 50,000 records, it's great Mark. The only anomoly I came across wa son IE7 and it was intermittent, you get the odd blank grid now and again after it says loading, but after you click on the top or bottom buttons of the scrollbar the page appears…so it has loaded the data.

I moved my project from Access to MySQL to use the LIMIT function as this project will probably goto 200,000 records, so the load while scrolling feature is superb as I did not want to use the pagination.

I am using it in conjunction with auto searchiing, filtering the grid as a user keys in a search term. Works excellent! so fast!


Keep up the good work.

Regards

Mark C.

14:20
30/10/2009


fuhrysteve

Member

posts 12

Post edited 19:28 – 30/10/2009 by fuhrysteve


Been testing the scroll feature like crazy on my test site. It's pretty fantastic.


I have, however, found some quirks in certain situations:

1. variable row sizes (scrolling near the bottom gets really screwy)
2. changing the height of the table itself (lots of things go nuts).

I have my grid setup to match the size of the page; here's my code for that:

$(window).bind('resize', function() {
    var minheight = 300, minwidth = 800, mygrid = 'my_grid_id', gridobj = $('#' + mygrid);
   
    // may need to subtract sidebar width, if applicable
    var width = $(window).width() – 20;
    if (width < minwidth) {
        width = minwidth;
    }
    gridobj.setGridWidth(width);
   
    if($("#gbox_" + mygrid).position().top > $(window).scrollTop()) {
        var height = $(window).height() – $(window).scrollTop() – $("#gbox_" + mygrid).position().top – 120;
        if (height < minheight) {
            height = minheight;
        }
        gridobj.setGridHeight(height);
    }
   
}).trigger('resize');

18:57
30/10/2009


Mark C

Guest

Just some feedback on the loading while scrolling, sometimes the grid loses it's select highllighted row.

The functions click and double click still fire, just on a single click the row usually highlights with the themed color, but it loses it intermittently.

Just one to check


Regards

Mark C.

19:13
30/10/2009


Mark C

Guest

Loading whilst scrolling – Came across a more serious problem: IE7 and FF3


The grid is sometimes letting me multiselect rows, it then gives me an error when i doubleclick a row whilst 2 or more are highlighted or once i get the error just double clicking any cell then throws the eroor, I use doubleclick to obtain a pdf and show it in a seprate window, the pdf name is built from the data in the selected row.

$t.p.colModel[...]name' is null or not an object

It seems to lose its rowid maybe?

Regards

Mark C



About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

Rajesh.Bhopalan@cognizant.com

Johnny

76 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9584

Posts: 28761

Membership:

There are 10129 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1157

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

Moderators: tony (7001 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information