Hello All,
i create a new Model. in the ListView i created 2 pages ListView.php & listviewdefs.php.
In the ListView.php page , i wrote the following code to render the page:
// setup listview smarty
$lv = new ListViewSmarty();
$displayColumns = array();
// get user defined display columns
$savedDisplayColumns = $current_user->getPreference('ListViewDisplayColumns', $currentModule);
//check $_REQUEST if new display columns sent from post,
//this is for when a user manually enters/submits a search
if(!empty($_REQUEST['displayColumns']))
{
foreach(explode('|', $_REQUEST['displayColumns']) as $num => $col)
{
if(!empty($listViewDefs['CRMInvoices'][$col]))
$displayColumns[$col] = $listViewDefs['CRMInvoices'][$col];
}
}
//this is for when a user selects/runs a saved search
elseif(!empty($savedDisplayColumns))
{
// use user defined display columns from preferences
$displayColumns = $savedDisplayColumns;
}
else
{
//use columns defined in modules/Widgets/metadata/listviewdefs.php
//for default display columns
foreach($listViewDefs['CRMInvoices'] as $col => $params)
{
if(!empty($params['default']) && $params['default'])
$displayColumns[$col] = $params;
}
}
//setup ListViewSmarty params
$params = array('massupdate' => true);
if(!empty($_REQUEST['orderBy']))
{
// order by coming from $_REQUEST
$params['orderBy'] = $_REQUEST['orderBy'];
$params['overrideOrder'] = true;
if(!empty($_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder'];
}
$lv->displayColumns = $displayColumns;
//use the generic listview smarty template to render pages by default
$lv->setup($seedCRMInvoice, 'include/ListView/ListViewGeneric.tpl', $where, $params);
echo get_form_header($mod_strings['LBL_LIST_FORM_TITLE'] , '', false);
//have the list view object run the query and build the list view from the results
echo $lv->display();
My problem is that list view appears without any data, can any one help me to solve this problem


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks