i was trying to add image same as above pic in feature table and on row-select zoom to point
below is my code for featuretable i tried to add image for objectid
Any suggestions
Thanks
var myFeatureTable = new FeatureTable({
featureLayer: layerdata,
map: map,
editable: false,
dateOptions: {
datePattern: 'M/d/y',
timeEnabled: true,
timePattern: 'H:mm',
},
syncSelection: true,
showRelatedRecords: true,
showAttachments: true,
fieldInfos: [
{
name: 'OBJECTID',
alias: 'Zoom to Location',
//formatter: makeZoomButton('${objectid}')
}
],
menuFunctions: [
],
outFields: ["*"],
}, 'myTableNode');
myFeatureTable.startup();
function makeZoomButton(id) {
//set the feature 'id' as the alt value for the image so that it can be used to query below
var zBtn = "<div data-dojo-type='dijit/form/Button'><img src='ZoomIn.png' alt='" + id + "'";
zBtn = zBtn + " width='18' height='18'></div>";
return zBtn;
}
Solved! Go to Solution.
Malla,
NOT an easy task, but here is some guidance:
fieldInfos
{
name: 'OBJECTID',
alias: ' ',
editable: false,
format: {
template: '<span class="esri-icon-zoom-in-magnifying-glass"></span>'
}
}
next
myFeatureTable.on("load", function(evt){
myFeatureTable.grid.on("td.field-OBJECTID:click", function(evt){
var OID = myFeatureTable.selectedRows[0].OBJECTID;
//Do your zoom event stuff here
});
});
myFeatureTable.startup();
I can't do all the coding for you, but this will get you started.
Malla,
NOT an easy task, but here is some guidance:
fieldInfos
{
name: 'OBJECTID',
alias: ' ',
editable: false,
format: {
template: '<span class="esri-icon-zoom-in-magnifying-glass"></span>'
}
}
next
myFeatureTable.on("load", function(evt){
myFeatureTable.grid.on("td.field-OBJECTID:click", function(evt){
var OID = myFeatureTable.selectedRows[0].OBJECTID;
//Do your zoom event stuff here
});
});
myFeatureTable.startup();
I can't do all the coding for you, but this will get you started.
Thanks Robert, it worked
How to implement same(add image in featuretable grid)
in ArcGIS API for js 4. x FeaturerTable widget, please suggest.