EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: getk on June 03, 2013, 04:40:35 AM



Title: Submit data without a form
Post by: getk on June 03, 2013, 04:40:35 AM
Hi folks,

With help of EasyUI I was able to do great job and is stable.
Currently I'm doing initializing external URL as follows  

Code:
function editAlert(){
var row = $('#dg').datagrid('getSelected');

if (row){
window.open(myurl);
}

}

The final format of "myurl" should be
Code:
https://externalURL/somelocation/ReceiveData.aspx?query={"Parameters":[{"Key":"start_date","Value":"2013-01-01"},{"Key":"end_date","Value":"2013-02-01"}],"Report"}
Where the key, value etc are all present in the selected row.

How can I enrich the URL before I send (without a form)? Can I do an append to the URL?
(or can I use jquery's native "push" option?)





Title: Re: Submit data without a form
Post by: tomhj on June 03, 2013, 04:26:56 PM
Not sure why you want to send JSON data as a request parameter.   I would just build the URL as a set of parm=value pairs appended to the url:

function editAlert() {
    var row = $('#dg').datagrid('getSelected');
    if (row) {
        url = "https://externalURL/somelocation/ReceiveData.aspx?query=Report&start_time=" + row.start_date + "&end_date=" + row.end_date;
        window.open(url);
    }
}