1

probably the strangst thing I've ever seen: I want to load a grid after the document is loaded. Since the grid (infragistics) seems to delay, I set a interval, in the interval I try to get the needed element, if I cant find it, I wait another 500 ms:

    function trySetEditMode(obj) {
        var testObj = $('#' + obj.btnId).parents("tr[type='row']").get(0);

        if (testObj && testObj._object){
            clearInterval(_intervalId);

The funny thing is: Even if I see the with the IE debugging tool the row is there, it justdoenst find it. It works just when I move arround with the mouse. This effect seems totally random.

Has anyone an idea how this is possible? I tried to tinker arorund with .focus, .blur etc, but nothing seems to work.

btw: obj is a custom object from me, the button id is the clientid of the button and is there. For example:

$('#' + obj.btnId).parents('tr').length

returns a length.

Can this be a bug from the infragistics control? If yes, how could I simulate this mouseMove?

Best regards

Matthias

4

2 回答 2

1

在客户端创建行对象的成本很高,因此它们是按需创建的,以避免在最初创建所有行对象时对性能造成很大影响。这些对象的实际创建是在鼠标悬停时或当您使用作为客户端对象模型的一部分提供的 get_row() 方法时。因此,推荐的方法是使用客户端对象模型来获取对行的引用,例如以下将获取第一行:

var grid = $find("webDataGrid1");  

var row = grid.get_rows().get_row(0);
于 2013-08-01T20:59:19.047 回答
0

可能其他人也会在使用 infragistics webdatagrid 时遇到这个问题:旁注:我不敢相信 ig 支持不能告诉我:网格有点延迟加载,dom 被加载,但是 ig 相关属性和后面的对象在你去的时候才被加载鼠标悬停。所以不管我等了多久,对象不只是在那里。

由于我没有时间找到合适的解决方案,我基本上手动触发了单元格上的鼠标悬停事件。你做什么都没关系,但我用第一个测试它并且它工作正常。

            //The grid doesnt load data (except the first row) until the mouse did hover over it
            //Get a cell, and hover over it
            var parentTd = btn.parents('td').first();
            var cell = parentTd.siblings()[0];
            var rows = $find('dgrRoles').get_rows();
            if (cell && rows) {
                cell.target = cell;
                rows._onMouseOver(cell);
            }
于 2013-07-05T07:22:25.510 回答