use parameters via url like views does
enboig - May 12, 2008 - 13:56
| Project: | Ajax Table |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I really like this module, it does the job quicker than views and more user-friendly; my question is how to give dynamic parameters to it.
For example, I want to create a page index.php?q=list/4 list all the posts inside taxonomy 4. Is this possible? how can this be achieved?
thanks

#1
I changed ajaxtable_render to accept a new parameter $override and use it when calling the table; it worked like a charm when first loading the table; but the $override is lost when updated/sorting/searching the table :'(
I was calling the function like this:
<?phpfunction comptacau_taula_suppliers($proveidor=0) {
if ($proveidor>0) {
//anem a crear el filtre:
$override=array(
'query' => "SELECT node.nid AS nid, node.title AS title, assentament.import, assentament.paid, assentament.data, assentament.project_nid AS project_nid, project.title AS project_txt FROM {comptacau_assentaments} assentament
INNER JOIN {node} node ON assentament.nid = node.nid
INNER JOIN {wu_nodes} wu ON assentament.nid = wu.nid
INNER JOIN {node} project ON assentament.project_nid = project.nid
WHERE node.type = 'comptacau_assentament'
AND assentament.exercici=".$_SESSION['comptacau_exercici']." ".
($_SESSION['working_unit_active']>0 ? "AND wu.wu_ref=0".$_SESSION['working_unit_active'] : "" ).
" AND assentament.supplier_nid=".$proveidor
,
);
return ajaxtable_render('comptacau_taula_assentaments','',false,'',$override);
}
else return ajaxtable_render('comptacau_taula_suppliers');
}
?>
And I changed de ajaxtable.module as:
line 57: function ajaxtable_render($id,$uid='',$refresh=FALSE,$input_value='',$override=null) {
line 74: $table = $function_name($override);
Any hint of how to get this work?
#2
With my modifications it is possible to pass $override to ajaxtable_render(), maybe if in the table definitions the add into de array the override itself, it can be easily pass through the ajax calls.
Right now other parts of the projects are more urgent/important than this; I will take a look when I have time