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 Populating Text box based on drpdown values?
19/07/2012
00:13
Avatar
aamir
New Member
Members
Forum Posts: 2
Member Since:
13/07/2011
sp_UserOfflineSmall Offline

Hi,

First time in this forum....The situation is.. I want to dynamically insert value in the textbox once value is selected/changed in combobox. How can I do this ? I am quite new to JQGrid...

$(document).ready(function(){

$("#datagrid").jqGrid({

url:'actionpo.php?vid=polpogridjq',

datatype: 'xml',

mtype: 'GET',

colNames:['List#','PO#', 'Item Code','Item Detail','Qty','Price','Tax'],

colModel :[

{name:'polistno', width:100,editable:true,editable:true,key:true},

{name:'polpono',index:'polpono', width:100,editable:true,key: false },

{name:'politemcode',index:'politemcode', width:100, align:'right',sortable:true,editable:true,edittype: "select", editrules: { required: true }, editoptions: { size: 1,

dataUrl:'actionpo.php?vid=populatesel',

dataEvents :[

{ type: 'change', fn: function(e) {

var thisval = $(e.target).val();

$.get('actionpo.php?vid=getitemname&itemcode='+thisval, function(data)

{ var res = $(data).html();

alert (res)

$('#politemname').html(res);

}); // end get

}//end func

} // end type

] // dataevents

}//edit options

},

{name:'politemname',id:"L1", width:300, align:'left',sortable:false,editable:true},

{name:'politemqty',width:50, align:'right',sortable:false,editable:true},

{name:'politemvalue', width:80,align:'left',sortable:false,editable:true},

{name:'politemtax', width:50, align:'right',editable:true}

],

pager: $('#pager'),

rowNum:10,

rowList:[10,20,30],

sortname: 'polpono',

sortorder: 'desc',

shrinkToFit: false,

rownumbers: false,

multiselect: false,

viewRecords: false,

clearAfterAdd:true,

caption: 'Itemised Quantity',

editurl: "actionpo.php?vid=gridformcall",

}

).navGrid('#pager', { edit: true, add: true, del: true ,search:false, refresh:true},{

//Edit Options

},{ //Add Options

},{

//Delete Options

width: 350,

caption: 'Delete User',

msg: 'Are you sure you want to delete this User?\nThis action is irreversable.' ,

onclickSubmit: function(rp_ge, postdata) {

rp_ge.url = "actionpo.php?vid=gridformcall&delpono=" +

$('#datagrid').getCell (postdata, 'polpono');

}

},

{} //Search options

);

});

The textbox is "politemname" and dropdown list is "politemcode". combo list is working fine its just I am not able to assign value I receieve from "$.get('actionpo.php?vid=getitemname&itemcode='+thisval, function(data) " to text box.

Also is there a way to get the ids of element(CSS i think) names from modal form in JQgrid ?

Aamir

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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