Have this function but it doesn’t seem to execute correctly. Here it is:
function chooseCols(colTag,tagName) {
// Set name column
var column = $('.tagChooser:eq('+ colTag +')');
column.parents('.col').css('background','#EAF3EA');
column.val(tagName);
} setTimeout(chooseCols(data.col_name,'colName'), 2000);
With execute correctly I mean that the right select option is not chosen and the background color of it’s parent stays the same.
OH btw, data.col_name is a json object I get from an ajax call. It gives me an index I can use for selecting the right .
Any tips are welcome!!
Thanks
Try this:
Your problem is because you invoke your function (
chooseCols(data.col_name,'colName')) and passundefinedinstead of function tosetTimeout.