Multirow operation ,method clone

Talk about implementation of multirow operations

Moderators: ne_moj, zewa

eagle0473
Junior
Junior
Posts: 20
Joined: Mar 3rd, '10, 20:57

Multirow operation ,method clone

Postby eagle0473 » Oct 14th, '10, 09:40

Hi admin,

Can I use method clone for copy selected row in another table?

If is possible , how to make it ?


Thank you so much

administrator
Site Admin
Site Admin
Posts: 5937
Joined: Jan 7th, '09, 23:18
Contact:

Re: Multirow operation ,method clone

Postby administrator » Oct 17th, '10, 08:04

Find CloneRow() method of datagrid.class.php and re-write it according to your needs.

eagle0473
Junior
Junior
Posts: 20
Joined: Mar 3rd, '10, 20:57

Re: Multirow operation ,method clone

Postby eagle0473 » Oct 17th, '10, 15:31

Thanks for the aswer,

ok for clone method ,now I have another question .

I need copy many rows in differente table .

I create a dropdown list out of datagrid with name of some table.

For example I create this code:

Code: Select all

if(isset($_GET[$unique_prefix.'mode']) && ($_GET[$unique_prefix.'mode'] == "copy") )
{
 
   $rid = explode("-", $_GET['abc_rid']);
   $i_rid = count($rid);

   $idstatement = array();
   for ($i=0; $i < $i_rid; $i++) {
      $idstatement[] = "'".$rid[$i]."'";
   }
   $rid = implode("," , $idstatement);

   
   $sql = "INSERT INTO ".$table."  values (colm1,colum2) .............WHERE id IN (".$rid.")";
   $result = mysql_query($sql);
    // refresh your page
    echo "<meta>";


$table is the variable.
When I selected the value from dropdown list and I run the script , the variable is always empty!

How I pass the variable in right way?

Thanks for your patience

administrator
Site Admin
Site Admin
Posts: 5937
Joined: Jan 7th, '09, 23:18
Contact:

Re: Multirow operation ,method clone

Postby administrator » Oct 18th, '10, 08:45

You have to pass it or via URL or via some hidden field, depending on the PostBack method you use.
Look how datagrid passes the selected RIDs and simply add there your variable too.

eagle0473
Junior
Junior
Posts: 20
Joined: Mar 3rd, '10, 20:57

Re: Multirow operation ,method clone

Postby eagle0473 » Nov 11th, '10, 11:01

Solved thanks and sorry for delay of the answer.

Mister
Senior
Senior
Posts: 33
Joined: Dec 8th, '10, 10:05
Location: Ukraine(eastern part of Europe :D ), Kharkiv
Contact:

Re: Multirow operation ,method clone

Postby Mister » Dec 9th, '10, 08:42

as I do not found the another subject-write here, the multirow operation "delete" do not work in 6.1.1 version!


Return to “Settings: multirow operations”