I am having trouble with using AJAX. I have controller class derived from AAdmin with following action:
Code:
protected function doActionMyAction()
{
$list = \XLite\Core\Request::getInstance()->idlist;
echo $list;
}
I also have this piece so that I do not get forbidden thrown at me when I attempt to call that action:
Code:
public static function defineFreeFormIdActions()
{
return array_merge(
parent::defineFreeFormIdActions(),
array('myaction')
);
}
In my javascript file I have this piece to perform AJAX call:
Code:
var str = "TEST STRING";
core.post(
URLHandler.buildURL({ target: "crosscheck_order", action:
"myaction" }),
function (XMLHttpRequest, textStatus, data, valid) {
console.log(data);
},
{ idlist: str}
);
Instead of getting value of "str" in my console, I instead get raw html of the entire default template for this controller. Any tips on what I am doing wrong are very appreciated!