Error from datapicker in hook table_name.php function 'dv'

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
dwmilli
Posts: 2
Joined: 2015-01-10 03:46

Error from datapicker in hook table_name.php function 'dv'

Post by dwmilli » 2015-02-24 15:37

Problem/Error using hook table_name.php and function table_name_dv when
trying to present a master-detail view.

Following error:
var
loc=scriptFiles[scriptFiles.length-1].src.substr(0,scriptFiles[scriptFiles.length-1].src.lastIndexOf("/"))+"/resources/datepicker/js/lang/"+datePicker.languageinfo+".js";

Unable to get property 'src' of undefined or null reference

CODE:
function litter_tb_dv($selectedID, $memberInfo, &$html, &$args){

// if a litter is selected, display its details.
if($selectedID){

$html.='<h3>Litter Details</h3>';
$id=makeSafe($selectedID);

// get litter items
$res=sql(
"select hog_id, hog_litter_id, hog_nm, hog_sex, hog_farrowed, ".
" hog_reg_dt, hog_reg_num, hog_sire_id, hog_dam_id, hog_comments ".
"from hog_tb left join litter_tb ".
"on litter_tb.litter_id = hog_tb.hog_litter_id ".
"where hog_litter_id='$id' ".
"order by hog_id "
, $eo);

if(mysql_num_rows($res)){

// list hog items inside a table
$html.='<table>';

// column titles
$html.='<tr>'.
'<td>hog_id</td>'.
'<td>hog_litter_id</td>'.
'<td>hog_nm</td>'.
'<td>hog_sex</td>'.
'<td>hog_farrowed</td>'.
'<td>hog_reg_dt</td>'.
'<td>hog_reg_num</td>'.
'<td>hog_sire_id</td>'.
'<td>hog_dam_id</td>'.
'<td>hog_comments</td>'.
'</tr>';

// iterate through hog items
while($row=mysql_fetch_row($res)){

$html.="<tr>".
"<td>TESTTESTTEST</td>".
"<td>$row[1]</td>".
"<td>$row[3]</td>".
"<td>$row[4]</td>".
"<td>$row[5]</td>".
"<td>$row[6]</td>".
"<td>$row[7]</td>".
"<td>$row[8]</td>".
"<td>$row[9]</td>".
"</tr>";
}

$html.='</table>';
}
}
}



Screenshot:
AXP Project file:
http://bigprof.com/appgini/sites/defaul ... try_ft.axp

Post Reply