Cell Operations on Unidbgrid

Source: Internet
Author: User



One, make a row a column cell disabled:



1. Unistringgrid Options, goediting = True



2. Add Event Beforeedit, Unistringgrid, extevents

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 ...


Second, get the cell value when the client clicks Unigrid: 

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:
 
function cellclick(sender, metaData, td, cellIndex, record, tr, rowIndex, e, eOpts)
{ 
  alert(sender.store.getAt(tr).get(td));
} 


Or:


function cellclick(sender, metaData, TD, CellIndex, record,  TR, rowIndex, e, eopts)          {
var fieldname=sender.getgridcolumns () [Cellindex].dataindex;
Alert (Record.get (fieldname));
}           

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.