EasyUI Forum
March 28, 2024, 09:34:01 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Access Datagrid in iframe  (Read 5012 times)
sky-t
Full Member
***
Posts: 145


View Profile
« on: May 20, 2017, 12:24:46 AM »

I want to append / delete rows in a datagrid that is located in an iframe.
I cann access and manipulate other dom objects in that iframe but not the datagrid

Code:
var table_cc=$("#iframe").contents().find("#dg");

if (table_cc != undefined) {
console.log(table_cc);
table_cc.datagrid('appendRow',{
name: 'from socket',
code: 'inforo'
});
}


How can we solve this?
Logged
sky-t
Full Member
***
Posts: 145


View Profile
« Reply #1 on: May 21, 2017, 09:25:00 PM »

any ideas?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #2 on: May 22, 2017, 06:33:28 PM »

Define a function in your iframe.
Code:
function appendRow(){
$('#dg').datagrid('appendRow', {
name:'from socket',
code:'inforo'
})
}

And then call this function in your top window.
Code:
window.frames['iframe'].appendRow();
Logged
sky-t
Full Member
***
Posts: 145


View Profile
« Reply #3 on: May 22, 2017, 10:28:21 PM »

Hi jarry,

this is working! Thank you so much!!!
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!