EasyUI Forum
June 15, 2024, 04:19:48 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Submit data without a form  (Read 6557 times)
getk
Newbie
*
Posts: 23


View Profile
« 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?)



« Last Edit: June 03, 2013, 05:09:49 AM by getk » Logged
tomhj
Newbie
*
Posts: 40


View Profile
« Reply #1 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);
    }
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!