 | PHP Builder free solutions for web developers
|
|
|
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!
| View previous topic :: View next topic |
| Author |
Message |
administrator Site Admin


Joined: 05 Oct 2006 Posts: 538 : Location: Israel
Items
|
Posted: Thu Feb 08, 2007 2:09 pm Post subject: HOW TO: three methods to make a filed as link to edit mode |
|
|
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 |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Tue Mar 13, 2007 3:59 pm Post subject: This second option does not operate |
|
|
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 " <a class='class_a' href='$curr_url'>".$row[$this->modes['edit']['byFieldValue']]."</a> ";$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=" ");
$this->colClose();
}else{
$this->colOpen(($this->direction == "rtl")?"right":"left",0,"nowrap",$main_td_color,"class_td_main");echo " <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> ";$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  _________________ 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 |
|
 |
administrator Site Admin


Joined: 05 Oct 2006 Posts: 538 : Location: Israel
Items
|
Posted: Tue Mar 13, 2007 8:56 pm Post subject: |
|
|
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 |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Tue Mar 13, 2007 10:17 pm Post subject: As is he the difference? |
|
|
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 |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Wed Mar 14, 2007 4:20 am Post subject: Solved |
|
|
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  _________________ Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez |
|
| Back to top |
|
 |
administrator Site Admin


Joined: 05 Oct 2006 Posts: 538 : Location: Israel
Items
|
Posted: Wed Mar 14, 2007 8:18 pm Post subject: |
|
|
Right version
| Code: | Fixed in new version, but don't write
Code:
"byFieldValue"=>"tblCountries.Name"
Right syntax:
Code:
"byFieldValue"=>"Name" |
|
|
| Back to top |
|
 |
| |
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|