0

flexigridからセルの値を取得する方法については何も見つからないようです。

チェックされたすべての項目の3番目の列のセル値を取得しようとしています(各行にはチェックボックスがあります)。

行IDを取得する関数がありますが、3番目の列で機能させることができません。(フレキシグリッドなので、3列目が常に3列目になるとは限らないように並べ替えることができます)

これが私の関数です:

function getSelectedExhibitIDs() {
        var selectedExhibitsList = new Array;
        var exhibitNumber = new Array;
        var i = 0;
        $('.exhibitCheckBox:checked').each(function () {
            if ($(this)[0].id !== "checkAllExhibits") {
                selectedExhibitsList[i] = $(this)[0].id.split('_')[1];
                ++i;
            }
        });
        return selectedExhibitsList;
    }
4

1 に答える 1

1

3列目にアクセスしようとしていないようです。

$('.exhibitCheckBox:checked').each(function (i) {
   if ($(this)attr('id') !== "checkAllExhibits") {

        // This will take you to the parent tr in which the checked checkbox is
        var $tr = $(this).closest('tr');
        //Need to find the 3rd cell in the current row

        var third = $tr.find('watyouwant');

        // Next you need to find the 3rd cell you want and add it to a array
        selectedExhibitsList[i] = third.attr(id).split('_')[1];
    }
});
于 2012-09-28T17:40:49.117 に答える