I just made a $form['table']. It shows enough rows (the count of the total rows in database) only it doesn't show the results. I tried using #value, #title, #markup but nothing works
Screenshot of result:
My code:
function push_notifications_stats_form($form, &$form_state) {
$form = array();
$id = $_GET['id'];
$query = db_query('SELECT * FROM push_notifications_messages WHERE msg_appID = :app_id', array(':app_id' => $id));
$qCount = db_query('SELECT * FROM push_notifications_messages WHERE msg_appID = :app_id', array(':app_id' => $id))->rowCount();
$form['table'] = array(
'#theme' => 'table',
'#header' => array(t('Message'), t('Device'), t('Date')),
'#rows' => array(),
);
foreach($query as $result) {
for($i = 1; $i <= $qCount; $i++) {
$form['table']["#rows"]["r$i"] = array(
"'c1'" => array(
'#type' => 'textfield',
'#value' => t('hoi'),
),
'c2' => array(
'#type' => 'textfield',
'#title' => t('device')
),
'c3' => array(
'#type' => 'textfield',
'#title' => t('device'),
),
);
}
}
$form['id'] = array(
'#type' => 'item',
'#title' => 'Application ID',
'#description' => t('The application ID you are viewing: @appId', array('@appId' => $id)),
);
return $form;
}
When I check the $form with dsm it does show the results.. And also when I use my browsers element inspector it does show the values. Only it puts them inside the first tag. while it should be between the tags
<td #type="textfield" #value="hoi" #data="hoi"></td>