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
trigger("reloadGrid")?bug or not?
20/06/2008
10:29
Avatar
zatomant
Member
Members
Forum Posts: 5
Member Since:
17/06/2008
sp_UserOfflineSmall Offline

<script type="text/javascript">
jQuery(document).ready(function(){
var lastsel2
jQuery("#list2").jqGrid({
url:'edit.php?nd='+new Date().getTime(),
datatype: "json",
colNames:['id','name', 'type.','act'],
colModel:[
{name:'id',index:'id', width:55, sortable:false,editable: false},
{name:'name',index:'name', width:55,editable: false},
{name:'actual',index:'actual', width:60, align:"center",editable: true,edittype:"checkbox",editoptions: {value:"Yes:No"}},
{name:'act',index:'act', width:75, align:"center",sortable:false, editable:false} ],
rowNum:20,
rowList:[10,20,30,50,100],
imgpath: 'images',
pager: jQuery('#pager2'),
sortname: 'name',
viewrecords: true,
sortorder: 'asc',
loadComplete: function(){
var ids = jQuery("#list2").getDataIDs();
for(var i=0;i<ids.length;i++){
var cl = ids[i];
toact = "<div class=btosave title='Save' onclick=UserSave("+cl+");>&nbsp;</div>";
jQuery("#list2").setRowData(ids[i],{act:toact});
}
},
onSelectRow: function(id){
if(id && id!==lastsel2){
jQuery('#list2').restoreRow(lastsel2);
jQuery('#list2').editRow(id,true);
lastsel2=id; }
},
 editurl: "edit.php"
});
});
var timeoutHnd;
var flAuto = false;
function doSearch(ev){
if(!flAuto) return;
var elem = ev.target||ev.srcElement;
if(timeoutHnd)
clearTimeout(timeoutHnd)

timeoutHnd = setTimeout(gridReload,500)
}
function gridReload(){
var nm_mask = jQuery("#item").val();
jQuery("#list2").setUrl("adminuserslist.php?nm_mask="+nm_mask);
jQuery("#list2").setPage(1);
jQuery("#list2").trigger("reloadGrid");
}
function enableAutosubmit(state){
flAuto = state;
jQuery("#submitButton").attr("disabled",state);
}
function adminUserSave(aid) {
jQuery('#list2').saveRow(aid,checksave);
}
function checksave(result){
if (result=="") {alert("Fatal error!"); return false;} jQuery("#list2").trigger("reloadGrid"); return true;
}
</script>

User can see table with data and can edit "type" column. user change type and press Enter - save data and fine. but if user change data and click on button Save - data save to server fine, server responce Ok and run event  "checksave". this event work and set trigger("reloadGrid") - grid fill data from server. fine? fine but not  - after that user click to another row and "lastrow" is restored with older data!!!

trigger("reloadGrid") isnt clear array data?

22/06/2008
02:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hi,

Just try in this function - after grid reload use setGridParam({selrow: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.

22/06/2008
06:15
Avatar
zatomant
Member
Members
Forum Posts: 5
Member Since:
17/06/2008
sp_UserOfflineSmall Offline

tnx, but this cant help.

best regards

maxim

23/06/2008
10:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Check what is with lastsel2. I think you should d something with this if the button is clicked

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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