zoukankan      html  css  js  c++  java
  • 对unidbgrid的单元格操作

    一、使某行某列单元格disabled:

    1. UniStringGrid -> Options -> goEditing = true

    2. UniStringGrid -> ExtEvents -> add event beforeedit

    function beforeedit(editor, context, eOpts) {  
      var FixedRow, FixedCols;
      FixedRow = 1; 
      FixedCols = 1;   
      if (editor.cmp.uniRow < FixedRow || editor.cmp.uniCol < FixedCols) {
         return false;
      }
    }
    It can be used also in UniDBGrid, to lock some cells ...

    二、在客户端点击unigrid时取得cell值:
    Hi wxb_km. 
     
    Basically, your question should be solved as follows: 

    1. Need to use the function 

    cellclick(sender, metaData, td, cellIndex, record, tr, rowIndex, e, eOpts)

    2. Here cellIndex - is the column index and rowIndex - the index of the row. http://docs.sencha.c...event-cellclick

    3. And use it to get the value:

    sender.store.getAt(rowIndex).get(cellIndex)

    i.e.:

    function cellclick(sender, metaData, td, cellIndex, record, tr, rowIndex, e, eOpts)
    {  
      alert(sender.store.getAt(rowIndex).get(cellIndex));
    } 
    But in my case (I use UniGUI 0.94.0.1023, under certain circumstances), I think some of the variables swapped! 
    For me works if I do so:
    function cellclick(sender, metaData, td, cellIndex, record, tr, rowIndex, e, eOpts)
    { 
      alert(sender.store.getAt(tr).get(td));
    } 

    或者:

    function cellclick(sender, metaData, td, cellIndex, record, tr, rowIndex, e, eOpts)
    {
    var fieldname=sender.getGridColumns()[cellindex].dataIndex;
    alert(record.get(fieldname));
    }
     
  • 相关阅读:
    MUSIC分辨率与克拉美罗下界的关系
    EXCEL 基本函数
    新手如何正确的开始练车
    5.20考试整理
    树上倍增 x
    逆元 x
    BSGS ! x
    【テンプレート】LCA
    [HDOJ5783]Divide the Sequence(贪心)
    [HDOJ5791]Two(DP)
  • 原文地址:https://www.cnblogs.com/wxb-km/p/3842355.html
Copyright © 2011-2022 走看看