Bug Tracker

Modify

Ticket #9568 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

customize tag's attribute

Reported by: Raymond.Gao@… Owned by: Raymond.Gao@…
Priority: low Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: Cc:
Blocking: Blocked by:

Description

i have a customize html like below: <codeA id="002" disabled="disabled" checked="checked" myattr="myattr2" />

use function "attr", i can get attribute myattr, but not disabled or checked

any suggestion ?

sample like:  http://jsbin.com/agofe4

Change History

comment:1 follow-up: ↓ 2 Changed 2 years ago by anonymous

use prop() functon...

comment:2 in reply to: ↑ 1 Changed 2 years ago by badtoto

Replying to anonymous:

use prop() functon...

take a look at my sample code at  http://jsbin.com/agofe4

i used prop(), it does nothing.

i think it doesn't work for reserved word by customize tag

comment:3 Changed 2 years ago by timmywil

  • Owner set to Raymond.Gao@…
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to attributes

hmm, so you need disabled and checked on an invalid html tag where disabled and checked don't actually do anything on that tag? It will work if the page is made an xml page.

comment:4 Changed 2 years ago by timmywil

Let me revise my statement. It's supposed to work if set to xml, but hooks are currently set whether it is xml or not. I can fix that much.

comment:5 Changed 2 years ago by badtoto

set to xml ? does it meens the tag is closed ? i did it.

it works well for customize attribute , in my example is "myattr".

in my project, i inherit a layout xml from an exist project, and rerender it to html page, so i need it.

now i use getAttribute function to get the value.

comment:6 Changed 2 years ago by timmywil

  • Status changed from pending to closed
  • Resolution set to fixed

Attribute hooks do not need to be attached in XML docs. Fixes #9568.

Changeset: 641ad802111d2dc16ccf4b3721784a6addaf20df

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.