我目前正在使用Ruby-on-rails开发一个网站。我把手风琴放在我的表格上。
label_songlist[i].Text=filename[i];
label_songlist[i].Height=25;
label_songlist[i].Location=new Point(x,y);
label_songlist[i].AutoSize=true;
label_songlist[i].Font=new Font(FontFamily.GenericSansSerif,10);
label_songlist[i].BorderStyle=BorderStyle.FixedSingle;
label_songlist[i].Padding=new Padding(0,0,0,5);
panel.Controls.Add(label_songlist[i]);
我一直在使用<div id="accordion" class="accordion no-margin">
<div class="accordion-group">
<div class="accordion-heading">
<a href="#accordion-ci" data-parent="#accordion" data-toggle="collapse" class="accordion-toggle">
<i class="icon-th"></i>
COMMERCIAL ITEM
</a>
</div>
<div class="accordion-body in collapse" id="accordion-ci" style="height: auto;">
<div class="accordion-inner">
<!--
revised by: hansen.salim@nutrifood.co.id, August 31st 2017
adding id to connect to JS for drag n drop
-->
<!--<table class="table table-condensed table-striped table-bordered table-hover no-margin">-->
<table class="table table-condensed table-striped table-bordered table-hover no-margin" id="sortable">
<thead>
<tr>
<th style="width:20%">ITEM DESCRIPTION</th>
<th style="width:20%">SECONDARY ITEM DESCRIPTION</th>
<th style="width:10%">PRICE</th>
<th style="width:8%">PRICE ON MASTER</th>
<th style="width:8%">QUANTITY</th>
<th style="width:9%">VOLUME (CBM)</th>
<th style="width:9%">WEIGHT (KG)</th>
<th style="width:10%">TOTAL FOB (USD)</th>
<th style="width:6%">ACTION</th>
</tr>
</thead>
<tbody id="ci">
<%= render partial: 'item_detail', collection: @ci_products %>
<tr>
<td colspan="9">
<ul>
<li>
<a href="#" class="add_buyer_sales_contract_detail btn btn-success" data-icon=""></a>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<br />
</div>
</div>
</div>
</div>
测试本地运行的网站。结果很好,手风琴将在单击标题时显示表单。然后我将在分期阶段测试它。我已经推送到服务器,然后预编译它localhost:3000
。
然后问题出现了,我测试了手风琴,但它没有显示出它应该的形式。我尝试过这样的东西来检查:
rake assets:clean
这是实现手风琴的折叠功能。我试图添加警报来检查javascript和jquery是否有效。当我在Staging中再次测试它时,在我点击标题后,Alert“Hide”工作(因为默认表单已打开),然后弹出另一个Alert“Open”。似乎两者都是
show: function () {
var dimension
, scroll
, actives
, hasData
if (this.transitioning) return
dimension = this.dimension()
scroll = $.camelCase(['scroll', dimension].join('-'))
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
this.$element[dimension](0)
this.transition('addClass', $.Event('show'), 'shown')
$.support.transition && this.$element[dimension](this.$element[0][scroll])
alert("Open")
return this
}
, hide: function () {
var dimension
if (this.transitioning) return
dimension = this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', $.Event('hide'), 'hidden')
this.$element[dimension](0)
alert("Hide")
return this
}
和
hide()
功能同时工作。我不知道为什么在我的Local工作完美时会发生这种情况。