Filtering function with Dc.Js and Update Jquery Datatable











up vote
3
down vote

favorite












I have this function to refresh my charts with Dc.Js And update the selected features on my leaflet map.



  // Called when dc.js is filtered (typically from user click interaction)
var onFilt = function(chart, filter) {
updateMap(locations.top(Infinity));
};


So it filter on my bar chart in Dc.Js.



 citiesChart.on("filtered", function (chart, filter) {  

//console.log('11111111111');
//console.log(locations.top(Infinity));
updateMap(locations.top(Infinity));

});

dc.renderAll();

// Called when dc.js is filtered (typically from user click interaction)
var onFilt = function(chart, filter) {
console.log('fffff');
updateMap(locations.top(Infinity));
};


I also have a datable in Jquery that I want to refresh when interacting with the charts. I've tried different things to modify my variable 'var onFilt' but cant get it works.



datatable.on("filtered", function (chart, filter) { 

//console.log('11111111111');
//console.log(locations.top(Infinity));
updateMap(locations.top(Infinity));

});

dc.renderAll();

// Called when dc.js is filtered (typically from user click interaction)
var RefreshTable = function(chart, filter) {
console.log('fffff');
updateMap(locations.top(Infinity));


};

});


Is there a way to modify my 'var onFilt' so it will update my the datable also?










share|improve this question
























  • I don't understand. A datatable usually doesn't filter anything; it responds to filters. So you would want to listen to any filters on the other charts and then update the datatable, no?
    – Gordon
    Nov 5 at 5:05










  • Hi Gordon, Yes your right! So yes i need to update table in function of the filter selected.
    – Simon GIS
    Nov 5 at 5:31















up vote
3
down vote

favorite












I have this function to refresh my charts with Dc.Js And update the selected features on my leaflet map.



  // Called when dc.js is filtered (typically from user click interaction)
var onFilt = function(chart, filter) {
updateMap(locations.top(Infinity));
};


So it filter on my bar chart in Dc.Js.



 citiesChart.on("filtered", function (chart, filter) {  

//console.log('11111111111');
//console.log(locations.top(Infinity));
updateMap(locations.top(Infinity));

});

dc.renderAll();

// Called when dc.js is filtered (typically from user click interaction)
var onFilt = function(chart, filter) {
console.log('fffff');
updateMap(locations.top(Infinity));
};


I also have a datable in Jquery that I want to refresh when interacting with the charts. I've tried different things to modify my variable 'var onFilt' but cant get it works.



datatable.on("filtered", function (chart, filter) { 

//console.log('11111111111');
//console.log(locations.top(Infinity));
updateMap(locations.top(Infinity));

});

dc.renderAll();

// Called when dc.js is filtered (typically from user click interaction)
var RefreshTable = function(chart, filter) {
console.log('fffff');
updateMap(locations.top(Infinity));


};

});


Is there a way to modify my 'var onFilt' so it will update my the datable also?










share|improve this question
























  • I don't understand. A datatable usually doesn't filter anything; it responds to filters. So you would want to listen to any filters on the other charts and then update the datatable, no?
    – Gordon
    Nov 5 at 5:05










  • Hi Gordon, Yes your right! So yes i need to update table in function of the filter selected.
    – Simon GIS
    Nov 5 at 5:31













up vote
3
down vote

favorite









up vote
3
down vote

favorite











I have this function to refresh my charts with Dc.Js And update the selected features on my leaflet map.



  // Called when dc.js is filtered (typically from user click interaction)
var onFilt = function(chart, filter) {
updateMap(locations.top(Infinity));
};


So it filter on my bar chart in Dc.Js.



 citiesChart.on("filtered", function (chart, filter) {  

//console.log('11111111111');
//console.log(locations.top(Infinity));
updateMap(locations.top(Infinity));

});

dc.renderAll();

// Called when dc.js is filtered (typically from user click interaction)
var onFilt = function(chart, filter) {
console.log('fffff');
updateMap(locations.top(Infinity));
};


I also have a datable in Jquery that I want to refresh when interacting with the charts. I've tried different things to modify my variable 'var onFilt' but cant get it works.



datatable.on("filtered", function (chart, filter) { 

//console.log('11111111111');
//console.log(locations.top(Infinity));
updateMap(locations.top(Infinity));

});

dc.renderAll();

// Called when dc.js is filtered (typically from user click interaction)
var RefreshTable = function(chart, filter) {
console.log('fffff');
updateMap(locations.top(Infinity));


};

});


Is there a way to modify my 'var onFilt' so it will update my the datable also?










share|improve this question















I have this function to refresh my charts with Dc.Js And update the selected features on my leaflet map.



  // Called when dc.js is filtered (typically from user click interaction)
var onFilt = function(chart, filter) {
updateMap(locations.top(Infinity));
};


So it filter on my bar chart in Dc.Js.



 citiesChart.on("filtered", function (chart, filter) {  

//console.log('11111111111');
//console.log(locations.top(Infinity));
updateMap(locations.top(Infinity));

});

dc.renderAll();

// Called when dc.js is filtered (typically from user click interaction)
var onFilt = function(chart, filter) {
console.log('fffff');
updateMap(locations.top(Infinity));
};


I also have a datable in Jquery that I want to refresh when interacting with the charts. I've tried different things to modify my variable 'var onFilt' but cant get it works.



datatable.on("filtered", function (chart, filter) { 

//console.log('11111111111');
//console.log(locations.top(Infinity));
updateMap(locations.top(Infinity));

});

dc.renderAll();

// Called when dc.js is filtered (typically from user click interaction)
var RefreshTable = function(chart, filter) {
console.log('fffff');
updateMap(locations.top(Infinity));


};

});


Is there a way to modify my 'var onFilt' so it will update my the datable also?







javascript jquery leaflet dc.js






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 5 at 8:42

























asked Nov 5 at 1:47









Simon GIS

748




748












  • I don't understand. A datatable usually doesn't filter anything; it responds to filters. So you would want to listen to any filters on the other charts and then update the datatable, no?
    – Gordon
    Nov 5 at 5:05










  • Hi Gordon, Yes your right! So yes i need to update table in function of the filter selected.
    – Simon GIS
    Nov 5 at 5:31


















  • I don't understand. A datatable usually doesn't filter anything; it responds to filters. So you would want to listen to any filters on the other charts and then update the datatable, no?
    – Gordon
    Nov 5 at 5:05










  • Hi Gordon, Yes your right! So yes i need to update table in function of the filter selected.
    – Simon GIS
    Nov 5 at 5:31
















I don't understand. A datatable usually doesn't filter anything; it responds to filters. So you would want to listen to any filters on the other charts and then update the datatable, no?
– Gordon
Nov 5 at 5:05




I don't understand. A datatable usually doesn't filter anything; it responds to filters. So you would want to listen to any filters on the other charts and then update the datatable, no?
– Gordon
Nov 5 at 5:05












Hi Gordon, Yes your right! So yes i need to update table in function of the filter selected.
– Simon GIS
Nov 5 at 5:31




Hi Gordon, Yes your right! So yes i need to update table in function of the filter selected.
– Simon GIS
Nov 5 at 5:31

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53147308%2ffiltering-function-with-dc-js-and-update-jquery-datatable%23new-answer', 'question_page');
}
);

Post as a guest





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53147308%2ffiltering-function-with-dc-js-and-update-jquery-datatable%23new-answer', 'question_page');
}
);

Post as a guest




















































































這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()