Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
multiple Rows selected inspite of multiselect: false
25/01/2010
16:10
Avatar
hpoe
hpoe
Member
Members
Forum Posts: 29
Member Since:
07/03/2009
sp_UserOfflineSmall Offline

Hello

I am experiencing a strange effect. In spite of multiselect = false, each rightClick or Click is selecting a row and resetSelection does not seem to work here. Any ideas what could be/go wrong here?

26/01/2010
18:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Be a sure that you have uniquie id in the grid. One possible reason is that all your rows have the same id.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

28/01/2010
11:18
Avatar
hpoe
hpoe
Member
Members
Forum Posts: 29
Member Since:
07/03/2009
sp_UserOfflineSmall Offline

Hi Tony

thank you for your answer. But that's not the case. The first Column is always the internal item #. Given by the underlying system it is not possible to have the same item# serveral times.

colNames and colModel are generated by a stored procedure and it is different for every page.

to see and try:

http://debrunner.mediando.ch/s.....duct=19391

best regards

hpoe

    var mygrid = $("#list").jqGrid({
url:'/shop/mediando/get_product.cfc?CFID=562549&CFTOKEN=47627565&method=getMasterproductInfo&id_masterproduct=84630&sprach_cd=d',
datatype: 'json',
mtype: 'GET',
colNames:['ID_O_PRODUCT','Artikel Nr','Ø<br />mm','L<br />mm','Bohr Ø Backstein<br />mm','Bohr Ø Beton<br />mm','Bohrtiefe d. anzuschl. Bauteil<br />mm','Ø Kopf<br />mm','TX','Aktionspreis','CHF/100 Stk','','productname','refcode'],
colModel:[
{name:'ID_O_PRODUCT',index:'ID_O_PRODUCT',key:true,hidden:true, search:false},
{name:'PRODUCT_NUMBER',index:'PRODUCT_NUMBER',sortable:false,search:false, width:75, align:'left'},
{name:'PA1.VALUE_1',index:'PA1.VALUE_1',width:90,align:'center',sortable:false,stype:'select',editoptions:{value:":All;7.5:7.5"}},
{name:'PA2.VALUE_1',index:'PA2.VALUE_1',width:90,align:'center',sortable:false,stype:'select',editoptions:{value:":All;42:42;52:52;62:62;72:72;82:82;92:92;102:102;112:112;122:122;132:132;152:152;182:182;212:212"}},
{name:'PA3.VALUE_1',index:'PA3.VALUE_1',width:90,align:'center',sortable:false,stype:'select',editoptions:{value:":All;6:6"}},
{name:'PA4.VALUE_1',index:'PA4.VALUE_1',width:90,align:'center',sortable:false,stype:'select',editoptions:{value:":All;6.5:6.5"}},
{name:'PA5.VALUE_1',index:'PA5.VALUE_1',width:90,align:'center',sortable:false,stype:'select',editoptions:{value:":All;52:52;62:62;72:72;82:82;92:92;102:102;112:112;122:122;132:132;142:142;162:162;192:192;222:222"}},
{name:'PA6.VALUE_1',index:'PA6.VALUE_1',width:90,align:'center',sortable:false,stype:'select',editoptions:{value:":All;7.3:7.3"}},
{name:'PA7.VALUE_1',index:'PA7.VALUE_1',width:90,align:'center',sortable:false,stype:'select',editoptions:{value:":All;25:25"}},
{name: 'AKTIONSPREIS',index:'AKTIONSPREIS',width:90, align:'center',formatter:function(cellv,opt,rowObj ) {if (cellv == 0) return leertxt;return $.currency(cellv,{s:"'",d:".",c:2});},sortable:false,search:false},
{name:'PRICE',index:'PRICE',width:90, align:'center',formatter:function(cellv,opt,rowObj ) {if (cellv == 0) return anfragtxt;return $.currency(cellv,{s:"'",d:".",c:2});},sortable:false,search:false},
{name:'art_nr',index:'art_nr',width:25, align:'left',sortable:false,search:false},
{name:'productname',index:'productname',hidden:true, align:'left',sortable:false,search:false},
{name:'refcode',index:'refcode',hidden:true, search:false}
],
pager: '#pager',
height: 'auto',
width: 850,
shrinkToFit: false,
forceToFit: false,
multiselect: false,
loadError: function(xhr,st,err) {alert('Type: '+st+'; Response: '+ xhr.status + ' '+xhr.statusText);},
loadonce: false,
loadui: "block",
altRows:false,
rowNum: 15,
rowList: [10,15,20,50,100,500,1000,1500],
sortname: 'PRODUCT_NUMBER',
sortorder: "asc",
viewrecords: true,
//The JSON reader. This defines what the JSON data returned from the CFC should look like
jsonReader: {
root: "ROWS", //our data
page: "PAGE", //current page
total: "TOTAL", //total pages
records:"RECORDS", //total records
userdata:"USERDATA", //Userdata we will pass back for feedback
cell: "", //Not Used
id: "0" //Will default to frist column
},
caption: 'Liste der Dimensionen',
afterInsertRow: function(rowid, aData){
$("#list").setCell( rowid, 'art_nr', '<img src="images/caddy.jpg" alt="wk" />', '');
//$("#"+rowid).contextMenu('menuJqGrid', eventsMenu);

$("#list").setCell( rowid, 'PRODUCT_NUMBER','', { "font-weight": "bold"});
$("#list").setCell( rowid, 'PRICE','', { "font-weight": "bold"});
$("#list").setCell( rowid, 'AKTIONSPREIS','', { "font-weight": "bold", "color":"red"});
},
loadComplete: function() {
var no_columns = $("#list").getGridParam("colModel").length-1;
var no_hiddens = 5; // incl. fixed column dim_nr, price, basket.img
if (rgt_basket == 1) {
no_hiddens = 6; // incl. fixed column dim_nr, price, basket.img
max_cols = 6;
} else {
no_hiddens = 3;
max_cols = 7;
}
var cols = no_columns - no_hiddens; // ohne hiddens und ohne dim_nr und warenkorb
if (cols <= max_cols) {
$("#list").setGridWidth(851,true);
}
// hier müsste getestet werden, ob die FilterToolbar aktiviert werden soll.
if (no_rows == 0) {
no_rows = $("#list").getGridParam("records");
// alert("rows=" + no_rows);
if (no_rows == 0) no_rows = 1;
if ( no_rows > 15) {
mygrid[0].toggleToolbar();
}
}

$("#list").contextMenu('menuJqGrid', eventsMenu);


}
,onCellSelect: function( rowid, iCol, aData) {
var no_columns = $("#list").getGridParam("colModel").length-1;
var last_column = no_columns;
id_product = $("#list").getCell(rowid, 'ID_O_PRODUCT');
dim_nr = $("#list").getCell(rowid, 'PRODUCT_NUMBER');
art_nr = $("#list").getCell(rowid, 'refcode');
productname = $("#list").getCell(rowid, 'productname');
// alert("iCol=" + iCol + "no_Collumns=" + no_columns);
//no_columns = no_columns - 1;
if (iCol == (no_columns-2)) {
toBasket(id_product, art_nr, dim_nr, productname);
} else {
alert("weitere Optionen mit rechter Maustaste");
}

}
,onRightClickRow: function( rowid, iRow, iCol, e ) {
//$('#list').setSelection(rowid,false);
dim_nr = $("#list").getCell(rowid, 'PRODUCT_NUMBER');
art_nr = $("#list").getCell(rowid, 'refcode');
id_product = $("#list").getCell(rowid, 'ID_O_PRODUCT');
productname = $("#list").getCell(rowid, 'productname');
//alert("dim_Nr:" + dim_nr + "nArt_nr:" + art_nr + "nid_product:" + id_product + "nproductname:" + productname);
}

});



28/01/2010
18:33
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

I see where is the problem

Your id's begin with space. Please trim the ids before send to the grid

Here is a part from your response

{"ROWS":[[" 21224"," 206.510.100"," 5"," 3"," 0.150"," 509.00"," 103105"],
[" 21225"," 206.510.110"," 6"," 3"," 0.220"," 494.00"," 103106"]

Best Regards
Tony

P.S. I will see how to avoid such situation in the future

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

29/01/2010
09:20
Avatar
hpoe
hpoe
Member
Members
Forum Posts: 29
Member Since:
07/03/2009
sp_UserOfflineSmall Offline

You are the man! Thank you.

It will not be easy to change that situation , because this is a very general routine in which I had to add the leading space because the string "0" and "00" became both 0 in the representation of some fields. I will try to make a distinction between the first and the other columns!

Thanks again and regards

hpoe

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
46 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information