SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.setCellStyleRows  method

パラメーターrowsで渡されるCellStyle設定たちをデータセルたちに個別的に設定する。 アレイのアレイであるか、Josn客体のアレイもありえる。 各項目にはグリッドの登録されているスタイルidが値で入っていなければならない。 

fieldMapにはrowsのどの位置にあるスタイル設定の値をデータセットのどのフィールドに適用させるかを設定する。 アレイの場合アレイインデックス->フィールド、Json客体の場合Jsonプロパティー->フィールドで指定する。 

エディターが表示されていたデータセルのエディターの状態は再設定して、グリッドを再び描画する。 

function setCellStyleRows (dataRowindicies: [Integer], fieldMap: *, startRowIndex: Integer, count: Integer);
Returns
Void
Parameters
dataRowindicies - [Integer]. required.
fieldMap - *. required.
startRowIndex - Integer. デフォルト値は0.
指定しなければ0.
count - Integer. デフォルト値は-1.
指定しなければDataSet.rowCount.
Code -1
    // 'style01'等はグリッドに登録されてるCellStyle達。
    var rows = [
        [ 'style01', 'style02' ],
        [ 'style03', 'style04' ]
    ];
    grid.setCellStyleRows(rows, {
        '0': 'country', // 上のrowsの最初の行の0番目の項目値'style01'をDataSetの'country'フィールドのCellStyle idとして設定。
        '1': 'currency'
    })

Json客体のアレイで指定。 

Code -2
    var rows = [{
        'style_country': 'style02',  
        'style_currency': 'style01'
    }, {
        'style_country': 'style03',  
        'style_currency': 'style02'
    }];
    grid.setCellStyleRows(rows, {
        'style_country': 'country', // 上のrowsの'style_country'プロパティーの値'style02'を'country'フィールドセルのスタイルidとして指定。        'style_currency': 'currency'
    }, 3) // 4番目DataSet行から適用
See Also
setCellStyle
CellStyle
Examples
Cell Styles