いくつかの非表示の行があるグリッドがあります。最初の2つの列をフリーズする必要がありますが、非表示の行がある場合、「setFrozenColumns」が機能しないことがわかりました。同じ問題を抱えている人はいますか?手伝って頂けますか?ありがとう。
質問する
2265 次
2 に答える
1
非表示の行または非表示の列のことですか? 現在、4.3.2 の時点で、凍結された列には次の制限があります。
次の制限は、凍結カラムを設定できない場合を示しています
- TreeGrid が有効な場合
- サブグリッドが有効な場合
- cellEdit が有効な場合
- インライン編集が使用されている場合 - 凍結された列は編集できません。
- 並べ替え可能な列が有効になっている場合 - grid パラメータ sortable が true に設定されているか、関数です
- scroll が true または 1 に設定されている場合
- データのグループ化が有効な場合
したがって、TreeGrid または SubGrid を使用している場合、凍結された列はまったく機能しません。
非表示の列があることを意味する場合は、凍結された列が機能するはずです-コードまたは問題を示す小さな例を投稿する必要がある場合があります。
于 2012-04-18T14:12:07.737 に答える
0
これは完全な例です:
var mydata = [
{
id: "1",
invdate: "2010-05-24",
name: "test",
note: "note",
tax: "10.00",
total: "2111.00"},
{
id: "2",
invdate: "2010-05-25",
name: "test2",
note: "note2",
tax: "20.00",
total: "320.00"},
{
id: "3",
invdate: "2007-09-01",
name: "test3",
note: "note3",
tax: "30.00",
total: "430.00"},
{
id: "4",
invdate: "2007-10-04",
name: "test",
note: "note",
tax: "10.00",
total: "210.00"},
{
id: "5",
invdate: "2007-10-05",
name: "test2",
note: "note2",
tax: "20.00",
total: "320.00"},
{
id: "6",
invdate: "2007-09-06",
name: "test3",
note: "note3",
tax: "30.00",
total: "430.00"},
{
id: "7",
invdate: "2007-10-04",
name: "test",
note: "note",
tax: "10.00",
total: "210.00"},
{
id: "8",
invdate: "2007-10-03",
name: "test2",
note: "note2",
amount: "300.00",
tax: "21.00",
total: "320.00"},
{
id: "9",
invdate: "2007-09-01",
name: "test3",
note: "note3",
amount: "400.00",
tax: "30.00",
total: "430.00"},
{
id: "11",
invdate: "2007-10-01",
name: "test",
note: "note",
amount: "200.00",
tax: "10.00",
total: "210.00"},
{
id: "12",
invdate: "2007-10-02",
name: "test2",
note: "note2",
amount: "300.00",
tax: "20.00",
total: "320.00"},
{
id: "13",
invdate: "2007-09-01",
name: "test3",
note: "note3",
amount: "400.00",
tax: "30.00",
total: "430.00"},
{
id: "14",
invdate: "2007-10-04",
name: "test",
note: "note",
amount: "200.00",
tax: "10.00",
total: "210.00"},
{
id: "15",
invdate: "2007-10-05",
name: "test2",
note: "note2",
amount: "300.00",
tax: "20.00",
total: "320.00"},
{
id: "16",
invdate: "2007-09-06",
name: "test3",
note: "note3",
amount: "400.00",
tax: "30.00",
total: "430.00"},
{
id: "17",
invdate: "2007-10-04",
name: "test",
note: "note",
amount: "200.00",
tax: "10.00",
total: "210.00"},
{
id: "18",
invdate: "2007-10-03",
name: "test2",
note: "note2",
amount: "300.00",
tax: "20.00",
total: "320.00"},
{
id: "19",
invdate: "2007-09-01",
name: "test3",
note: "note3",
amount: "400.00",
tax: "30.00",
total: "430.00"},
{
id: "21",
invdate: "2007-10-01",
name: "test",
note: "note",
amount: "200.00",
tax: "10.00",
total: "210.00"},
{
id: "22",
invdate: "2007-10-02",
name: "test2",
note: "note2",
amount: "300.00",
tax: "20.00",
total: "320.00"},
{
id: "23",
invdate: "2007-09-01",
name: "test3",
note: "note3",
amount: "400.00",
tax: "30.00",
total: "430.00"},
{
id: "24",
invdate: "2007-10-04",
name: "test",
note: "note",
amount: "200.00",
tax: "10.00",
total: "210.00"},
{
id: "25",
invdate: "2007-10-05",
name: "test2",
note: "note2",
amount: "300.00",
tax: "20.00",
total: "320.00"},
{
id: "26",
invdate: "2007-09-06",
name: "test3",
note: "note3",
amount: "400.00",
tax: "30.00",
total: "430.00"},
{
id: "27",
invdate: "2007-10-04",
name: "test",
note: "note",
amount: "200.00",
tax: "10.00",
total: "210.00"},
{
id: "28",
invdate: "2007-10-03",
name: "test2",
note: "note2",
amount: "300.00",
tax: "20.00",
total: "320.00"},
{
id: "29",
invdate: "2007-09-01",
name: "test3",
note: "note3",
amount: "400.00",
tax: "30.00",
total: "430.00"}
];
jQuery("#list47").jqGrid({
data: mydata,
datatype: "local",
height: 150,
rowNum: 999999,
scroll: false,
shrinkToFit: false,
width: 350,
colNames: ['Inv No', 'Date', 'Client', 'Amount', 'Tax', 'Total', 'Notes'],
colModel: [
{
name: 'id',
index: 'id',
width: 60,
sortable: false, frozen: true},
{
name: 'invdate',
index: 'invdate',
width: 90,
sorttype: "date",
formatter: "date"},
{
name: 'name',
index: 'name',
width: 100},
{
name: 'amount',
index: 'amount',
width: 80,
align: "right",
sorttype: "float",
formatter: "number"},
{
name: 'tax',
index: 'tax',
width: 80,
align: "right",
sorttype: "float"},
{
name: 'total',
index: 'total',
width: 80,
align: "right",
sorttype: "float"},
{
name: 'note',
index: 'note',
width: 150,
sortable: false}
],
pager: "#plist47",
viewrecords: true,
multiselect: true,
caption: "single selection",
beforeSelectRow: function(rowid, e)
{
//jQuery("#list47").jqGrid('resetSelection');
//return(true);
}
});
document.getElementById("1").style.display = 'none';
$("#list47").jqGrid("destroyFrozenColumns")
.jqGrid("setColProp","id",{frozen:true})
.jqGrid("setColProp","invdate",{frozen:true})
.jqGrid("setFrozenColumns")
この場合、列全体ではなくヘッダーのみが凍結されます。
于 2012-04-21T14:59:54.343 に答える