EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 21, 2024, 10:25:02 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Ceck if datagrid exist
Pages: [
1
]
« previous
next »
Print
Author
Topic: Ceck if datagrid exist (Read 6477 times)
rezzonico
Full Member
Posts: 184
Ceck if datagrid exist
«
on:
February 17, 2014, 06:27:08 AM »
Hi all,
I have 2 tabs (tab1 and tab2)
In each tab I have a datagrid (datagrid1 and datagrid2)
The "save" button" is in the first tab and it saves the two datagrid.
If I click on tab2, then on tab1 and then on the "save" button, all is ok.
But if after I start the program I click on the save button the javascript stops at the following command
var rows = $('#datagrid2').datagrid('getChanges','inserted');
The reason is that datagrid2 do not exist.
How can I check if datagrid2 exists ?
Thanks in advance
Miche
«
Last Edit: February 17, 2014, 06:28:49 AM by rezzonico
»
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Ceck if datagrid exist
«
Reply #1 on:
February 17, 2014, 05:51:02 PM »
To detect if a datagrid is initialized, call .data('datagrid') please. If the undefined value returned, you need to create datagrid before calling any methods.
Code:
var dg = $('#datagrid2');
if (!dg.data('datagrid')){
// no initialization
}
Logged
rezzonico
Full Member
Posts: 184
Re: Ceck if datagrid exist
«
Reply #2 on:
February 17, 2014, 11:51:52 PM »
Hi stworthy
thanks a lot !
Miche
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...