EasyUI Forum
September 18, 2025, 03:29:05 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: Defining options through data attribute  (Read 10600 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: January 29, 2016, 04:35:31 AM »

How can I define the data-options using javascript rather than through the html attribute "data-options" ?

http://jsfiddle.net/54v8nacp/31/

« Last Edit: January 29, 2016, 05:06:07 AM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 29, 2016, 08:19:51 AM »

Please try this:
http://jsfiddle.net/54v8nacp/32/
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: January 29, 2016, 03:57:26 PM »

Thanks, so it is not possible to add these attributes using the jquery xxx.data() method so that they are not part of the visible html source code ?


I am trying to achieve this without converting the object to a string and embedding it inside the element's inner html.

I have used a different method: http://jsfiddle.net/54v8nacp/38/


« Last Edit: January 29, 2016, 05:51:31 PM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: January 29, 2016, 06:51:18 PM »

Override the $.parser.parse function, the example works as you desired.

http://jsfiddle.net/54v8nacp/39/

You also can download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.4-patch.zip to get this feature.
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #4 on: January 29, 2016, 06:58:47 PM »

Ooh. that's great, will this be added as a standard feature or only available through a patch ?
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: January 30, 2016, 01:33:53 AM »

This is a standard feature that will be included in next edition.
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!