X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcustomer-table.html;h=3c3f8b2ee32531b36310965ed9ddbd4d1324efa8;hb=e4c72328fb4c89eca20c4fe7645252ecb287ba89;hp=779b01c51e25b9ea69d582d61ce02807d5296b75;hpb=bb51c09147a727688b6cd49e8838b9219ff25d43;p=freeside.git diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html index 779b01c51..3c3f8b2ee 100644 --- a/httemplate/elements/customer-table.html +++ b/httemplate/elements/customer-table.html @@ -4,17 +4,37 @@ Example: include( '/elements/customer-table.html', + ### + # required + ### + #listrefs... - 'header' => [ '#', 'Item' ], - 'fields' => [ - 'column', - sub { my ($row,$param) = @_; - $param->{"column$row"}; - }, - ], - 'sizes' => [], # sizes ignored for immutable - 'types' => ['immutable', ''], # immutable or ''/text - 'param' => { column0 => 1 }, # preset column of row 0 to 1 + 'header' => [ '#', 'Item' ], + 'fields' => [ + 'column', + sub { my ($row,$param) = @_; + $param->{"column$row"}; + }, + ], + + ### + # optional + ### + + 'name_singular' => 'customer', #label + 'custnum_update_callback' => 'name_of_js_callback' #passed a rownum + + #listrefs + 'types' => ['immutable', ''], # immutable or ''/text + 'align' => [ 'c', 'l', 'r', '' ], + 'size' => [], # sizes ignored for immutable + 'color' => [], + 'footer' => ['string', '_TOTAL'], # strings or the special + #value _TOTAL + 'footer_align' => [ 'c', 'l', 'r', '' ], + + 'param' => { column0 => 1 }, # preset column of row 0 to 1 + ) %doc> @@ -79,6 +99,9 @@ Example: if ( name.length > 0 ) { customer.value = name; customer.setAttribute('magic', 'nosearch'); +% if ( $opt{custnum_update_callback} ) { + <% $opt{custnum_update_callback} %>(searchrow, '<% $opt{prefix} %>') +% } } else { customer.value = 'Not found'; customer.style.color = '#ff0000'; @@ -143,6 +166,9 @@ Example: customer_obj.style.display = ''; customer_select.style.display = 'none'; +% if ( $opt{custnum_update_callback} ) { + <% $opt{custnum_update_callback} %>(searchrow, '<% $opt{prefix} %>') +% } } else { @@ -204,6 +230,10 @@ Example: this.style.display = 'none'; customer_obj.style.display = ''; +% if ( $opt{custnum_update_callback} ) { + <% $opt{custnum_update_callback} %>(searchrow, '<% $opt{prefix} %>') +% } + } } @@ -232,12 +262,20 @@ Example: