PHP Builder Forum IndexPHP Builder
free solutions for web developers
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in            Calendar



COMPUSORY UPGRADE!!! Request an upgrade NOW! 32+ Pre-installed Modifications! 3 Server Locations to choose from: USA, UK and JAPAN.

11th December 2012 - phpBB88: All servers are upgraded to run using SSD drive. Click Here to report problems!

HOW TO: three methods to make a filed as link to edit mode

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PHP Builder Forum Index -> PHP DataGrid {developers/users}
View previous topic :: View next topic  
Author Message
administrator
Site Admin
Site Admin


Joined: 05 Oct 2006
Posts: 538
:
Location: Israel

Items

PostPosted: Thu Feb 08, 2007 2:09 pm    Post subject: HOW TO: three methods to make a filed as link to edit mode Reply with quote

1) Click on edit button and copy all address string from your browser
(when you want to hide specifical field)

Let it be:
http://mysite.com/pid=39&mode=edit&rid=33&page_size=100&p=1&sort_field=1&sort_type=desc

Change it on
http://mysite.com/pid=39&mode=edit&page_size=100&p=1&sort_field=1&sort_type=desc&rid=

And write in $vm_colimns:

"name"=>array("header"=>"Full Name", "type"=>"link", "align"=>"left", "field"=>"mid", "prefix"=>"http://mysite.com/pid=39&mode=edit&page_size=100&p=1&sort_field=1&sort_type=desc&rid=", "target"=>"",
"text_length"=>"-1"),

Where mid is field name (primary key) in the target table


2) Let you have field, named d_field in SELECT statment.
(when you want to use specifical field instead of 'Edit')

Now, write in $modes :
"edit"=>array("view"=>true, "edit"=>true, "type"=>"link", "byFieldValue"=>"d_field"),


3) Make a link on a separate page, where you can proccess edit/update operations:
(when you use hardly linked tables etc.)

"name"=>array("header"=>"Full Name", "type"=>"link", "align"=>"left", "field"=>"rid",
"prefix"=>"http://mysite.com/my_edit.php?rid=", "target"=>"",
"text_length"=>"-1"),


4) You also can save needed url parameters in $_SESSION
See here: http://www.phpbb88.com/phpbuilder/viewtopic.php?t=82&mforum=phpbuilder


Last edited by administrator on Sat Feb 17, 2007 1:50 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Tue Mar 13, 2007 3:59 pm    Post subject: This second option does not operate Reply with quote

This second option does not operate

At the class, the code:

************************************
Line 1457

if(isset($this->modes['edit'][$this->mode]) && $this->modes['edit'][$this->mode]){
if (isset($this->modes['edit']['byFieldValue']) && ($this->modes['edit']['byFieldValue'] == "")){
$this->colOpen("center",0,"nowrap",$main_td_color,"class_td_main");
$this->drawModeButton("edit", $curr_url, $this->lang['edit'], $this->lang['edit_record'], "edit.gif", "\"javascript:document.location.href='http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$curr_url."'\"", false, $nbsp=" ");
$this->colClose();
}else{
$this->colOpen(($this->direction == "rtl")?"right":"left",0,"nowrap",$main_td_color,"class_td_main");echo "&nbsp;<a class='class_a' href='$curr_url'>".$row[$this->modes['edit']['byFieldValue']]."</a>&nbsp;";$this->colClose();
}
}
********************************

It's not right

********************************

Solved ---->> Suggestion
---------------------------------------------

if(isset($this->modes['edit'][$this->mode]) && $this->modes['edit'][$this->mode]){
if (isset($this->modes['edit']['byFieldValue']) && ($this->modes['edit']['byFieldValue'] == "")){
$this->colOpen("center",0,"nowrap",$main_td_color,"class_td_main");
$this->drawModeButton("edit", $curr_url, $this->lang['edit'], $this->lang['edit_record'], "edit.gif", "\"javascript:document.location.href='http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$curr_url."'\"", false, $nbsp="&nbsp;");
$this->colClose();
}else{



$this->colOpen(($this->direction == "rtl")?"right":"left",0,"nowrap",$main_td_color,"class_td_main");echo "&nbsp;<div align='center'><a class='class_a' href='http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$curr_url."'>".$row[$this->getFieldOffset($this->modes['edit']['byFieldValue'])]."</a></div>&nbsp;";$this->colClose();



}
}

****************************************

It's supposed to be the value of the selected field in ("byFieldValue"):

Correct
--------

"edit"=>array("view"=>true, "edit"=>true, "type"=>"link", "byFieldValue"=>"Name"),

Incorrect
----------

"edit"=>array("view"=>true, "edit"=>true, "type"=>"link", "byFieldValue"=>"tblCountries.Name"),

Thanks Razz
_________________
Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez


Last edited by fcallez on Wed Mar 14, 2007 4:15 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
administrator
Site Admin
Site Admin


Joined: 05 Oct 2006
Posts: 538
:
Location: Israel

Items

PostPosted: Tue Mar 13, 2007 8:56 pm    Post subject: Reply with quote

Fixed in new version, but don't write
Code:
"byFieldValue"=>"tblCountries.Name"

Right syntax:
Code:
"byFieldValue"=>"tblCountries.Name"


Generally, I plan to redo this option or remove it in nearests versions.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Tue Mar 13, 2007 10:17 pm    Post subject: As is he the difference? Reply with quote

Good day

As is he the difference?

administrator wrote:
Fixed in new version, but don't write
Code:
"byFieldValue"=>"tblCountries.Name"

Right syntax:
Code:
"byFieldValue"=>"tblCountries.Name"


Generally, I plan to redo this option or remove it in nearests versions.


It would be interesting that it be used with the primary key of the table

Thanks
_________________
Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Wed Mar 14, 2007 4:20 am    Post subject: Solved Reply with quote

Solved

Please, checking the previous forum (Published the Mar 13, 2007 10:59 am)

I suggest that the option keep on, It is interesting and can be useful....

Greetings Wink
_________________
Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
administrator
Site Admin
Site Admin


Joined: 05 Oct 2006
Posts: 538
:
Location: Israel

Items

PostPosted: Wed Mar 14, 2007 8:18 pm    Post subject: Reply with quote

Right version

Code:
Fixed in new version, but don't write
Code:
"byFieldValue"=>"tblCountries.Name"

Right syntax:
Code:
"byFieldValue"=>"Name"
Back to top
View user's profile Send private message Send e-mail Visit poster's website
     
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PHP Builder Forum Index -> PHP DataGrid {developers/users} All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
PHP Builder topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

FREE FORUM HOSTING by AtFreeForum. Terms of Service - Privacy Policy
FASHION ACCESSORIES - BLING BLING - LADIES WATCHES - KOREAN CHILDREN CLOTHING - ONLINE BARGAIN STORE - FASHION JEWELLERIES