<div class="window_cell_table" style="left:{{$pos_left}};top:0px; width:{{$table_width}}; height:{{$table_height}}px;"> <div style="padding-left:1px;padding-top:5px">
<span class="title_text" id="question_font" style="margin-left:5px;">{{include file='page_elements/question_font.tpl'}}</span>{{ translator->display_aide code=$rub_id_libelle }}<img src="icones/gif_19/filet_19/generique.gif" onclick="{{if $purview eq '1'}}addRubriqueAttach({{$id_rub}},{{$id_site}});{{else}}showRubriqueAttach({{$id_rub}},{{$id_site}}){{/if}}" style="margin-left:10px; vertical-align:-30%">{{if $purview eq "1"}}<img id="add_attach" src="icones/gif_19/filet_19/detailler.gif" style="margin-left:10px; vertical-align:-30%" onclick="addType1InputRow({{$rub_id_libelle}}, type1_question_list_{{$rub_id_libelle}},type1_newRow_value{{$id_rub}},type1_question_control_{{$rub_id_libelle}},type1_question_type_reponse_{{$rub_id_libelle}});return false;">{{/if}}
</div>
<div id="div_title_{{$rub_id_libelle}}" class="cell_type1_content" style="left:0px;top:26px;height:{{$table_height-28}}px;">
{{if $question_list|@count > 0}}
{{if $page_model == 1}}
{{if $question_list|@count < 3}}
{{assign var="cell_table_width" value="100%"}}
{{if $purview == 1}}
{{assign var="ope_area_width" value="10"}}
{{math equation='(x-z)/y' x='100' y=$question_list|@count z=$ope_area_width assign='cell_width'}}
{{assign var='cell_width' value=$cell_width|string_format:"%.2f%%"}}
{{assign var='ope_area_width' value=$ope_area_width|string_format:"%d%%"}}
{{else}}
{{math equation='x/y' x='100' y=$question_list|@count assign='cell_width'}}
{{assign var='cell_width' value=$cell_width|string_format:"%.2f%%"}}
{{/if}}
{{else}}
{{assign var="ope_area_width" value="40"}}
{{math equation='x*y+z' x=$question_list|@count y='140' z=$ope_area_width assign='cell_table_width'}}
{{assign var='cell_table_width' value=$cell_table_width|string_format:"%dpx"}}
{{assign var='cell_width' value="140px"}}
{{assign var='ope_area_width' value=$ope_area_width|string_format:"%dpx"}}
{{/if}}
{{elseif $page_model==2 || $page_model==20 || $page_model==30}}
{{if $question_list|@count < 7}}
{{assign var="cell_table_width" value="100%"}}
{{if $purview == 1}}
{{assign var="ope_area_width" value="6"}}
{{math equation='(x-z)/y' x='100' y=$question_list|@count z=$ope_area_width assign='cell_width'}}
{{assign var='cell_width' value=$cell_width|string_format:"%.2f%%"}}
{{assign var='ope_area_width' value=$ope_area_width|string_format:"%d%%"}}
{{else}}
{{math equation='x/y' x='100' y=$question_list|@count assign='cell_width'}}
{{assign var='cell_width' value=$cell_width|string_format:"%.2f%%"}}
{{/if}}
{{else}}
{{assign var="ope_area_width" value="40"}}
{{math equation='x*y+z' x=$question_list|@count y='140' z=$ope_area_width assign='cell_table_width'}}
{{assign var='cell_table_width' value=$cell_table_width|string_format:"%dpx"}}
{{assign var='cell_width' value="140px"}}
{{assign var='ope_area_width' value=$ope_area_width|string_format:"%dpx"}}
{{/if}}
{{/if}}
<table id="table_{{$rub_id_libelle}}" style="border-collapse:collapse;margin-bottom:1px;width:{{$cell_table_width}};">
{{/if}}
<thead>
{{foreach item=question key=key from=$question_list}}
<td class="{{if $key==0}}data_header1{{elseif $purview==1 && $key < $question_list|@count}}data_header2{{elseif $key < $question_list|@count - 1}}data_header2{{else}}data_header3{{/if}}" style="width:{{$cell_width}};background-image:url(,'page_elements/question_font.tpl')">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</td>
{{include file='cell/creatcell.tpl' assign=test}}
<script type="text/javascript">
type1_newRow_value{{$id_rub}}.push('{{$test}}');
</script>
<script language="javascript">
type1_question_list_{{$rub_id_libelle}}.push("{{$question.id}}");
type1_question_control_{{$rub_id_libelle}}.push("{{$question.control}}");
type1_question_type_reponse_{{$rub_id_libelle}}.push("{{$question.type_reponse}}");
</script>
{{/foreach}}
{{if $purview eq "1" and $reponse_list.length != "0"}}
<td width={{$ope_area_width}} class="data_header3"> </td>
{{/if}}
</thead>
<tbody id="{{$rub_id_libelle}}">
<div id="div_title_{{$rub_id_libelle}}" class="cell_type1_content" style="left:0px;top:46px;height:{{$table_height-28}}px;">
{{if $reponse_length > 0}}
{{* assign var="index" value="0" *}}
{{section name=reponse_index loop=$reponse_length}}
{{assign var="index" value=$smarty.section.reponse_index.index}}
<tr id="oldReponse_type1_{{$index}}">
{{foreach item=question from=$question_list}}
<div id='question_creat_cell_templates_{{$question.id}}' style="display:none">
</div>
{{assign var="id_reponse" value=$reponse_list[$question.id][$index].id}}
{{assign var="value" value=$reponse_list[$question.id][$index].value}}
{{assign var="reponse" value=$reponse_list[$question.id][$index]}}
{{assign var="id_question" value=$question.id}}
{{assign var="input_id" value=type1$id_question$index}} {{* $input_id *}}
<td class="input_cell2">{{* $question.id *}} {{* $reponse.id *}}
{{include file='cell/cell.tpl'}}
</td>
<input type="hidden" name="id_question[]" value="{{$question.id}}" />
<input type="hidden" name="id_reponse[]" value="{{if $id_reponse}}{{$id_reponse}}{{/if}}" />
<input type="hidden" id="{{$question.id}}_type1_reponse_{{$index}}" value="{{if $id_reponse}}{{$id_reponse}}{{/if}}" />
{{/foreach}}
{{if $purview eq "1" and $reponse_list.length != "0"}}
<td width="30px" class="input_cell2"><!--<input type="image" onclick="delType1Reponse('oldReponse_type1_{{$index}}','table_{{$rub_id_libelle}}','{{$index}}',type1_question_list_{{$rub_id_libelle}});return false;" src="icones/gif_19/filet_19/supprimer.gif" style="margin-left:10px; vertical-align:-30%">--><img src="icones/gif_19/filet_19/supprimer.gif" onclick="delType1Reponse('oldReponse_type1_{{$index}}','table_{{$rub_id_libelle}}','{{$index}}',type1_question_list_{{$rub_id_libelle}});return false;" style="margin-left:10px; vertical-align:-30%"></td>
{{/if}}
</tr>
{{/section}}
{{/if}}
</div>
</tbody>
</table>
</div>
</div>
这是我写的页面,但在FIREFOX下有两个问题,一是动态添加几行新的行后,除了第一行的删除按钮有用,其他的点击都不起作用,二是我在TD添加了背景图片(aaaaaa那里),也出不来,请求达人解答一下!!!
<span class="title_text" id="question_font" style="margin-left:5px;">{{include file='page_elements/question_font.tpl'}}</span>{{ translator->display_aide code=$rub_id_libelle }}<img src="icones/gif_19/filet_19/generique.gif" onclick="{{if $purview eq '1'}}addRubriqueAttach({{$id_rub}},{{$id_site}});{{else}}showRubriqueAttach({{$id_rub}},{{$id_site}}){{/if}}" style="margin-left:10px; vertical-align:-30%">{{if $purview eq "1"}}<img id="add_attach" src="icones/gif_19/filet_19/detailler.gif" style="margin-left:10px; vertical-align:-30%" onclick="addType1InputRow({{$rub_id_libelle}}, type1_question_list_{{$rub_id_libelle}},type1_newRow_value{{$id_rub}},type1_question_control_{{$rub_id_libelle}},type1_question_type_reponse_{{$rub_id_libelle}});return false;">{{/if}}
</div>
<div id="div_title_{{$rub_id_libelle}}" class="cell_type1_content" style="left:0px;top:26px;height:{{$table_height-28}}px;">
{{if $question_list|@count > 0}}
{{if $page_model == 1}}
{{if $question_list|@count < 3}}
{{assign var="cell_table_width" value="100%"}}
{{if $purview == 1}}
{{assign var="ope_area_width" value="10"}}
{{math equation='(x-z)/y' x='100' y=$question_list|@count z=$ope_area_width assign='cell_width'}}
{{assign var='cell_width' value=$cell_width|string_format:"%.2f%%"}}
{{assign var='ope_area_width' value=$ope_area_width|string_format:"%d%%"}}
{{else}}
{{math equation='x/y' x='100' y=$question_list|@count assign='cell_width'}}
{{assign var='cell_width' value=$cell_width|string_format:"%.2f%%"}}
{{/if}}
{{else}}
{{assign var="ope_area_width" value="40"}}
{{math equation='x*y+z' x=$question_list|@count y='140' z=$ope_area_width assign='cell_table_width'}}
{{assign var='cell_table_width' value=$cell_table_width|string_format:"%dpx"}}
{{assign var='cell_width' value="140px"}}
{{assign var='ope_area_width' value=$ope_area_width|string_format:"%dpx"}}
{{/if}}
{{elseif $page_model==2 || $page_model==20 || $page_model==30}}
{{if $question_list|@count < 7}}
{{assign var="cell_table_width" value="100%"}}
{{if $purview == 1}}
{{assign var="ope_area_width" value="6"}}
{{math equation='(x-z)/y' x='100' y=$question_list|@count z=$ope_area_width assign='cell_width'}}
{{assign var='cell_width' value=$cell_width|string_format:"%.2f%%"}}
{{assign var='ope_area_width' value=$ope_area_width|string_format:"%d%%"}}
{{else}}
{{math equation='x/y' x='100' y=$question_list|@count assign='cell_width'}}
{{assign var='cell_width' value=$cell_width|string_format:"%.2f%%"}}
{{/if}}
{{else}}
{{assign var="ope_area_width" value="40"}}
{{math equation='x*y+z' x=$question_list|@count y='140' z=$ope_area_width assign='cell_table_width'}}
{{assign var='cell_table_width' value=$cell_table_width|string_format:"%dpx"}}
{{assign var='cell_width' value="140px"}}
{{assign var='ope_area_width' value=$ope_area_width|string_format:"%dpx"}}
{{/if}}
{{/if}}
<table id="table_{{$rub_id_libelle}}" style="border-collapse:collapse;margin-bottom:1px;width:{{$cell_table_width}};">
{{/if}}
<thead>
{{foreach item=question key=key from=$question_list}}
<td class="{{if $key==0}}data_header1{{elseif $purview==1 && $key < $question_list|@count}}data_header2{{elseif $key < $question_list|@count - 1}}data_header2{{else}}data_header3{{/if}}" style="width:{{$cell_width}};background-image:url(,'page_elements/question_font.tpl')">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</td>
{{include file='cell/creatcell.tpl' assign=test}}
<script type="text/javascript">
type1_newRow_value{{$id_rub}}.push('{{$test}}');
</script>
<script language="javascript">
type1_question_list_{{$rub_id_libelle}}.push("{{$question.id}}");
type1_question_control_{{$rub_id_libelle}}.push("{{$question.control}}");
type1_question_type_reponse_{{$rub_id_libelle}}.push("{{$question.type_reponse}}");
</script>
{{/foreach}}
{{if $purview eq "1" and $reponse_list.length != "0"}}
<td width={{$ope_area_width}} class="data_header3"> </td>
{{/if}}
</thead>
<tbody id="{{$rub_id_libelle}}">
<div id="div_title_{{$rub_id_libelle}}" class="cell_type1_content" style="left:0px;top:46px;height:{{$table_height-28}}px;">
{{if $reponse_length > 0}}
{{* assign var="index" value="0" *}}
{{section name=reponse_index loop=$reponse_length}}
{{assign var="index" value=$smarty.section.reponse_index.index}}
<tr id="oldReponse_type1_{{$index}}">
{{foreach item=question from=$question_list}}
<div id='question_creat_cell_templates_{{$question.id}}' style="display:none">
</div>
{{assign var="id_reponse" value=$reponse_list[$question.id][$index].id}}
{{assign var="value" value=$reponse_list[$question.id][$index].value}}
{{assign var="reponse" value=$reponse_list[$question.id][$index]}}
{{assign var="id_question" value=$question.id}}
{{assign var="input_id" value=type1$id_question$index}} {{* $input_id *}}
<td class="input_cell2">{{* $question.id *}} {{* $reponse.id *}}
{{include file='cell/cell.tpl'}}
</td>
<input type="hidden" name="id_question[]" value="{{$question.id}}" />
<input type="hidden" name="id_reponse[]" value="{{if $id_reponse}}{{$id_reponse}}{{/if}}" />
<input type="hidden" id="{{$question.id}}_type1_reponse_{{$index}}" value="{{if $id_reponse}}{{$id_reponse}}{{/if}}" />
{{/foreach}}
{{if $purview eq "1" and $reponse_list.length != "0"}}
<td width="30px" class="input_cell2"><!--<input type="image" onclick="delType1Reponse('oldReponse_type1_{{$index}}','table_{{$rub_id_libelle}}','{{$index}}',type1_question_list_{{$rub_id_libelle}});return false;" src="icones/gif_19/filet_19/supprimer.gif" style="margin-left:10px; vertical-align:-30%">--><img src="icones/gif_19/filet_19/supprimer.gif" onclick="delType1Reponse('oldReponse_type1_{{$index}}','table_{{$rub_id_libelle}}','{{$index}}',type1_question_list_{{$rub_id_libelle}});return false;" style="margin-left:10px; vertical-align:-30%"></td>
{{/if}}
</tr>
{{/section}}
{{/if}}
</div>
</tbody>
</table>
</div>
</div>
这是我写的页面,但在FIREFOX下有两个问题,一是动态添加几行新的行后,除了第一行的删除按钮有用,其他的点击都不起作用,二是我在TD添加了背景图片(aaaaaa那里),也出不来,请求达人解答一下!!!
===========================
function delType1Old(parameter_list){
var id_row = parameter_list[0];
var id_table = parameter_list[1];
var objTable = document.getElementById(id_table);
//---------------------
//var rows = objTable.rows;//这一行只适用于ie,你可以加点简单的浏览器判定.
//一下修改供参考:
//---------------------------------------
var userAgent = navigator.userAgent;
var Gecko = userAgent.indexOf('Gecko');
if(Gecko == -1) var rows = objTable.rows;//ie
else var rows = objTable.getElementsByTagName('tr');//firefox
//------------------------------------------
for(var i=0;i<rows.length;i++)
{
if(rows[i].id==id_row){
objTable.deleteRow(i);
return;
}
}
}问题2
=========================
background-image:url(,'page_elements/question_font.tpl')//括号里怎么会有一个,号,去掉试试