2012-04-04 11 views
2

JQgridモーダルウィンドウ内のtdにcolspan属性を適用したいと思います。それは次の構造Jqgrid Modal Colspan

<form ...> 
    <table ...> 
    <tbody> 
     <tr ...> 
     <td class="CaptionTD"></td> 
     <td class="DataTD"></td> 
     <td class="CaptionTD"></td> 
     <td class="DataTD"></td> 
     </tr> 
    </tbody> 
    </table> 
</form> 

でモーダルフォームをレンダリング私が利用可能なすべてのoptionsを見てきましたが、私は、TDのいずれかにCOLSPAN属性を適用する方法については不明です。私はセルにいくつかのスタイルを追加することに読んでいました。例えば "クラス"オプションを使用していましたが、私の知る限りでは(私の研究に基づいて...あなたがそれを呼ぶことができるなら)CSSを使ってテーブルのcolspanを設定することはできませんそれはスタイルとしてではなく、むしろ「テーブルへの構造的変化」

答えて

3

rowposcolposのプロパティformoptionsを使用して、2番目のラベルの列を非表示にしますか? colspanの使用状況がどのような状況で良いかを示すコード例を提供できますか?

一般にcolspan属性はbeforeShowFormコールバックに設定できます。一つは、あなたが<td>colspan=2を設定した場合、その後1は、同じ行のいくつかの以前の<td>要素を非表示通常

beforeShowForm: function() { 
    var $tr = $("#tr_name"), // 'name' is the column name 
     $label = $tr.children("td.CaptionTD"), 
     $data = $tr.children("td.DataTD"); 
    $data.attr("colspan", "2"); 
    $data.children("input").css("width", "95%"); 
    $label.hide(); 
} 

よう

// in the below example the column name is 'name' 
$("#tr_name>td:eq(1)").attr("colspan", "2"); 
$("#tr_name>td:eq(1)>input").css("width", "95%"); 
$("#tr_name>td:eq(0)").hide(); 

か何かのようなものを使用することができます。

結果1は

enter image description here

のようなものを得ることができます