看了文档,已解决,请结帖!
解决方法:
var firstData = this.comp("firstData");//select绑定的data文件,里边有cid,和names两个值
var first = this.getElementByXid("select1").value;//获取select上正在显示的数据
var cid="";//定义一个空的cid
var s = this;
firstData.each(function(param){//让data数据循环
var row = param.row;//定义row为当前
if(row.val('names')==first){//判断row在data中取到的names和页面上select选择的数据如果匹配
cid = s.comp("firstData").getValue("cid", row);//把当前row的cid取出来
}
});