简体   繁体   English

如何从FlexiGrid获取值

[英]How do I get values from a FlexiGrid

I can't seem to find anything on how to get a cells' value from a flexigrid. 我似乎找不到任何有关如何从flexigrid获取单元格值的信息。

I am trying to retrieve the third columns' cell value for every checked item.(each row has a checkbox). 我正在尝试为每个选中的项目检索第三列的单元格值。(每行都有一个复选框)。

I have a function that gets the rows id, but I cannot get it to work for the third column. 我有一个获取行ID的函数,但无法在第三列中使用它。 (Since it is a flexigrid you can rearrange things so third column won't always be third column) (由于它是弹性的,因此您可以重新排列内容,因此第三列不一定总是第三列)

Here is my function: 这是我的功能:

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;
    }

Looks like you are not trying to access the 3rd Column at all.. 看来您根本没有尝试访问第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];
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM