I'm trying to use the http://querybuilder.js.org/index.html plugin with coldfusion. I'm stuck on this part:
$('.parse-sql').on('click', function() {
var target = $(this).data('target');
var result = $('#builder-'+target).queryBuilder('getSQL',$(this).data('stmt'));
if (result.sql.length) {
var test =result.sql;
alert(test);
$('#debugDiv').empty().append('waarde'+ test + '</div>');
bootbox.alert({
title: $(this).text(),
message: '<pre class="code-popup">' + format4popup(result.sql) + (result.params ? '
' + format4popup(result.params) : '') + '</pre>'
});
}
});
What I'm trying to do is use the sql query in the result page. I have try some things like putting the result.sql in a variable test. Then display the TEST variable to a debugdiv, and that is working. The output is like "name LIKE('%Johnny%') AND ( category = 2 OR in_stock = 1 )".
Now the question: how can I use this in a result page? Must I export the variable with an AJAX request? Can someone help me a bit on this?
Thanks!