मैं handsontable जेएस प्लगइन का उपयोग कर रहा हूं। मैं getCellMetaafterChange हुक लेकिन काम नहीं कर रहा हूं। जब मैं चेंज हुक के बाद फ़ंक्शन का उपयोग करता हूं, फ़ंक्शन काम कर रहा है। लेकिन चेंज हुक के बाद में काम नहीं कर रहा है।हैंडोंटेबल पर चेंज के बाद getCellMeta का उपयोग कैसे करें?
var container = document.getElementById('t1'),
options = document.querySelectorAll('.options input'),
table,
hot;
hot = new Handsontable(container, {
autoWrapRow: true,
startRows: 81,
startCols: 206,
autoColumnSize : true,
stretchH: 'all',
afterChange : function(change,source) {
if (source === 'loadData') {
return;
}
var test = this.getCellMeta(change[0],change[1]); // not working, not return "id" meta
console.log(test);
}
});
$.ajax({
url: 'path',
type: 'GET',
dataType: 'json',
success: function (res) {
var data = [], row, pc = 0;
for (var i = 0, ilen = hot.countRows(); i < ilen; i++)
{
row = [];
for (var ii = 0; ii<hot.countCols(); ii++)
{
hot.setCellMeta(i,ii,'id',res[pc].id);
row[ii] = res[pc].price;
if(pc < (res.length-1)) {
pc++;
}
}
data[i] = row;
}
hot.loadData(data);
}
});
var test = this.getCellMeta(0,0); // is working, return "id" meta
console.log(test);
आउटपुट कंसोल लॉग मैंने चेंज के बाद कोशिश की;
आउटपुट कंसोल लॉग बाद में उपयोग करें;
परिवर्तन के बाद सेल मेटा कैसे प्राप्त करें?
धन्यवाद।
मैं इस प्लगइन से परिचित नहीं हूं लेकिन दस्तावेज़ केवल GetCellMeta और GetCellMeta के बाद दिखाता है; GetCellMeta कहां से आता है? – kshikama
[लिंक] (https://image.prntscr.com/image/pSN__mN-RpCONgy_320krA.png) @ क्षीकामा –