Make column as link?
Posted 30 October 2012 - 11:53 AM
1, 2, 3?
Posted 30 October 2012 - 11:55 AM
Posted 30 October 2012 - 12:02 PM
Posted 30 October 2012 - 12:27 PM
{
$crud = new grocery_CRUD();
$crud->set_table('project');
$crud->columns('name','slang','tlang','numwords','price','type','pvalid','state','rate');
$crud->callback_column('rate',array($this,'_callback_action'));
$output = $crud->render();
$this->_example_output($output);
}
public function _callback_action($value, $row)
{
if($row->state == 2)
{
return '<a href="'.site_url('signup/addratting/'.$row->state).'">******</a>';
}
else
{
return '---';
}
}
it's works.[attachment=335:list.jpg]
But, there is a bug with a searching.
I think that In future versions it will be fixed.
https://github.com/scoumbourdis/grocery-crud/issues/105
you can use a datatables grid as solution
Posted 30 October 2012 - 12:39 PM
$crud->callback_column('dummy',array($this,'_callback_action'));
public function _callback_action($value, $row)
{
if($row->state == 2)
{
return '<a href="'.site_url('signup/addratting/'.$row->state).'">******</a>';
}
else
{
return '---';
}
}
then you will have no error
Posted 30 October 2012 - 12:40 PM
second
i use your code
but it display the second return only
return '---';
Posted 30 October 2012 - 12:42 PM
i use your code
but it display the second return only
return '---';
[/quote]
because you have one row with value = 2.
check "show 100 rows" and you will see good result
Posted 30 October 2012 - 12:44 PM
Posted 30 October 2012 - 12:48 PM
really I like to Appreciates your efforts
my bug was that
function statvalue($value, $row)
{
if($value ==0)
{
return lang('new');
} elseif($value ==1)
{
return lang('Under_Subtitle');
} elseif($value ==2)
{
//$crud->add_action('rate', base_url().'images/good.png', '' ,'ui-icon-plus',array($this,'clientrate'));
return lang('finished');
}
}
finally thank you very much