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
PostData
28/07/2013
17:23
Avatar
em
New Member
Members
Forum Posts: 2
Member Since:
28/07/2013
sp_UserOfflineSmall Offline

    

I tried to pass in PostData that is calculated in runtime, but it doesnot work.

Something simple like this doesnot work($uid is not calculated in runtime):

$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
jqGridDB::query($conn,"SET NAMES utf8");
$grid = new jqGridRender($conn);
$query= 'SELECT employeename FROM employees where uid =?';
$grid->SelectCommand = $query;
$grid->dataType = 'json';

$uid=$_REQUEST['uid'];

$uid=($uid+2)/9;

$aux = array($uid);

// Let the grid create the model
$grid->setColModel(null, $aux);

// Set some grid options
$grid->setGridOptions(array(
    "rowNum"=>10,
    "height"=>"200″,
    "rowList"=>array(10,20,30),
    "sortname"=>"id",
   "postData"=>array("uid"=>$uid)
));

$grid->renderGrid('#grid','#pager',true, null, $aux, true,true);

Called using ?uid=16 in my URL. ((16+2)/9=2. When I used $uid=2 in replace of $uid=$uid/9+2 and it works fine but I need $uid to be calculated in run time -In the future, I need to encrypt the uid passed in as REQUEST parameter.).

Does JQGrid support real time calculation of the PostData, or is the PostData precalculated in someway since the above simple example doesnot work?

Thanks in advance.

28/07/2013
19:15
Avatar
em
New Member
Members
Forum Posts: 2
Member Since:
28/07/2013
sp_UserOfflineSmall Offline

Looks like I solved it.

The $uid calculation in the function is called twice for some reason.
So when I want $uid to be 2, I have to set the $REQUEST uid number to suppose the "$uid=($uid+2)/9;" being called twice.

Could be some bug in JQGrid?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 496

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