English 中文(简体)
为什么叫YUI数据表显示CellEditor不展示编辑?
原标题:Why does calling the YUI Datatable showCellEditor not display the editor?

在数据表第二层(任何一行)上进行点击,导致编辑显示。 但是,我试图从法典中显示编辑。 守则如下:

    var firstEl = oDataTable.getFirstTdEl(rowIndex);
    var secondCell = oDataTable.getNextTdEl(firstEl);
    oDataTable.showCellEditor(secondCell);

当我对数据表进行反驳时。 j 代码(无论是用点击还是从上面的代码)通过显示CellEditor功能遵循同样的道路,但上述代码不会显示编辑。

我正在使用第2.8.0r4号国际数据。

问题回答

我认为这是一个模糊的事件。

因此,例如,我有链接,必须增加数据表的记录,并显示其编辑。

var mymethod = function (e) {
  YAHOO.util.Event.stopEvent(e);
  var r = {};
  r.id = 0;
  r.value =  hello world ;

  myDataTable.addRow(r);
  var cell = myDataTable.getLastTrEl().cells[0];
  myDataTable.showCellEditor(cell);        
}

YAHOO.util.Event.addListener( mylink2addrecord_ID ,  click , mymethod);

不停 您永远不会看到编辑,因为有表格。 当你点击您的链接时,便叫作Blur活动。

你们可以尝试这样做——这是我拥有的一套较大的活动手法的灯塔。 EditNext,如果单元有:

   this.myDataTable.subscribe("editorKeydownEvent",function(oArgs) {
            var self = this,
                ed = this._oCellEditor,  // Should be: oArgs.editor, see: http://yuilibrary.com/projects/yui2/ticket/2513909
                ev = oArgs.event,
                KEY = YAHOO.util.KeyListener.KEY,
                Textbox = YAHOO.widget.TextboxCellEditor,
                Textarea = YAHOO.widget.TextareaCellEditor,
                DCE = YAHOO.widget.DateCellEditor,
                cell = ed.getTdEl(),
                col = ed.getColumn(),
                row,rec,

                editNext = function(cell) {
                    cell = self.getNextTdEl(cell);
                    while (cell && !self.getColumn(cell).editor) {

                        cell = self.getNextTdEl(cell);
                    }
                    if (cell) {
                        self.showCellEditor(cell);
                    }
                },

正如马奇所说的那样,你需要停止以前的活动。 由于某种原因,它(表Bur活动)与显示CellEditor功能发生冲突。 这是解决这一问题的第一个地方。

总之,我是:

YAHOO.util.Event.stopEvent(window.event);<br/>
dt.showCellEditor(td); // dt = yui datatable obj, td = {record: yuirecord, column: yuicolumn}

当然,如果你在马茨的岗位上可以轻易获得该活动标的,你可以像他那样通过该标的。





相关问题
YUI "Get" utility to parse JSON response?

The documentation page for the YUI "Get" utility says: Get Utility is ideal for loading your own scripts or CSS progressively (lazy-loading) or for retrieving cross-domain JSON data from ...

(YUI uploader) listeners not fiering events

I m trying to use YUI uploader, but I m not able to open the file dialog window when I click the browse button. I m following (more or less) the example on Yahoos demo. Here is my HTML code: <div ...

Make table rows sortable with YUI

Currently I have a table similar to below: <table id="tbl"> <thead> <tr><th>Example Title</th><th>Title2</th></tr> </thead> &...

Yahoo UI the popup implementation with YAHOO.widget.Dialog

I used the Yahoo.widget.dialog to implement a popup window. Currently, it popups only on the page which is belongs. If I am working on the other (tab browser) pages. The popup window will be not seen....

Error on YUI Anim sample

I m getting an error when trying to emulate an YUI Anim sample: <script src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script> <script> YUI().use( anim-base , ...

YUI onDragDrop multiple listeners

I was wondering if anyone was aware of an example that shows multiple listeners to the YUI DDProxy, DD, or DDTarget onDragDrop event. Currently I have a hacked up example going. I m using the http://...

热门标签