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_Related Related Topics sp_TopicIcon
JQGrid / DropDown - Cannot reproduce simple example
29/06/2011
19:58
Avatar
JQNovice
New Member
Members
Forum Posts: 2
Member Since:
29/06/2011
sp_UserOfflineSmall Offline

I'm trying to reproduce a simple JQGrid example on my computer (this is the example: http://www.trirand.com/blog/jq.....qgrid.html >> Row editing >> Input types)

When I visit the trirand site it works fine in my IE6, but when I'm trying to reproduce the grid on my computer, the drop down list is resetting to the first item whenever I open it (when I select ARAMEX it resets to FEDEX, the first item in the drop down list). The feature works fine in Firefox.

Please help:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DT.....t;&gt;
<html xmlns="http://www.w3.org/1999/xhtml&q.....t;&gt;
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" type="text/css" media="screen" href="themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
 
<script src="js/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>

    
    
    
    
    <script type="text/javascript">

$(document).ready(function() {
        var lastsel2
jQuery("#rowed5").jqGrid({
    datatype: "local",
    height: 250,
       colNames:['ID Number','Name', 'Stock', 'Ship via','Notes'],
       colModel:[
           {name:'id',index:'id', width:90, sorttype:"int", editable: true},
           {name:'name',index:'name', width:150,editable: true,editoptions:{size:"20",maxlength:"30"}},
           {name:'stock',index:'stock', width:60, editable: true,edittype:"checkbox",editoptions: {value:"Yes:No"}},
           {name:'ship',index:'ship', width:90, editable: true,edittype:"select",editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"}},        
           {name:'note',index:'note', width:200, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"10"}}        
       ],
    onSelectRow: function(id){
        if(id && id!==lastsel2){
            jQuery('#rowed5').jqGrid('restoreRow',lastsel2);
            jQuery('#rowed5').jqGrid('editRow',id,true);
            lastsel2=id;
        }
    },
    editurl: "server.php",
    caption: "Input Types"

});
var mydata2 = [
        {id:"12345",name:"Desktop Computer",note:"note",stock:"Yes",ship:"FedEx"},
        {id:"23456",name:"Laptop",note:"Long text ",stock:"Yes",ship:"InTime"},
        {id:"34567",name:"LCD Monitor",note:"note3",stock:"Yes",ship:"TNT"},
        {id:"45678",name:"Speakers",note:"note",stock:"No",ship:"ARAMEX"},
        {id:"56789",name:"Laser Printer",note:"note2",stock:"Yes",ship:"FedEx"},
        {id:"67890",name:"Play Station",note:"note3",stock:"No", ship:"FedEx"},
        {id:"76543",name:"Mobile Telephone",note:"note",stock:"Yes",ship:"ARAMEX"},
        {id:"87654",name:"Server",note:"note2",stock:"Yes",ship:"TNT"},
        {id:"98765",name:"Matrix Printer",note:"note3",stock:"No", ship:"FedEx"}
        ];
        
for(var i=0;i < mydata2.length;i++)
{
//alert(mydata2[i].id);
 jQuery("#rowed5").jqGrid('addRowData',mydata2[i].id,mydata2[i]);
 }

 
 });
    
    </script>
</head>

<body>

    

        <table id="rowed5"></table>
    
    
    
</body>
</html>

29/06/2011
21:25
Avatar
JQNovice
New Member
Members
Forum Posts: 2
Member Since:
29/06/2011
sp_UserOfflineSmall Offline

From the original trirand page source code I downloaded and included into my html all the js and css files. This solved the problem. Probably it was a conflict between two js files.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
22 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