Destroy row

introfini - May 9, 2009 - 02:05
Project:Views Custom Field
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed
Description

Hi,

Is possible to have a custom field that removes the row from a table if some conditions are met?

Thanks,
introfini

#1

casey - May 9, 2009 - 19:13
Status:active» postponed

Nope, but I'll think about it.

#2

introfini - May 9, 2009 - 19:25

Thanks!

That way we can for example make group by queries...

introfini

#3

sidharth_k - June 16, 2009 - 14:47

subscribing. Need this feature too.

#4

bfr - November 18, 2009 - 15:25

Here is my "delete" button i just got working(adds button to each row to delete node. You can change the button condition to anything else you want:

<?php
print "<form method='post'>";
print
"<input name='".$data->nid."' type='submit' value='delete' />";
print
"</form>";
$a=$_POST[$data->nid];
if (!empty(
$a))
    {
   
node_delete($data->nid); //delete node
   
node_load($data->nid, NULL, TRUE); //clear node from cache
   
print "removed";
    }
if(isset(
$_POST['submit']))
    {
    unset(
$_POST['submit']);
    }
?>

Any ideas how i could refresh the view after this(as you can see, now i have to use the "removed" text to inform that the row will be gone after next refresh)?

Also, can the "node blahblah has been deleted" text be disabled somehow?

 
 

Drupal is a registered trademark of Dries Buytaert.