Opened 9 years ago

Closed 9 years ago

#11871 closed defect (invalid)

Current custom data-* prefix parser has some degradation

Reported by: youngho Owned by: dante
Priority: high Milestone: tbd
Component: Parser Version: 1.5
Keywords: Parser Cc:
Blocked By: Blocking:

Description

Current custom data-* prefix parser has some degradation. Please refer to the attached test file.

when run test file, I got

missing : after property id http://localhost/js/dojo-src/dojo/tests/parser_fail.html Line 19

Attachments (3)

parser_fail.html (907 bytes) - added by youngho 9 years ago.
typo fixed test file
parser_fail.2.html (1011 bytes) - added by youngho 9 years ago.
2nd fixed test file
parser_fail_IE8.html (1.2 KB) - added by youngho 9 years ago.
IE8, the custom class name didn't set at all

Download all attachments as: .zip

Change History (15)

comment:1 Changed 9 years ago by Fredde

Looks like you are mixing single and double quotes on line 20 in the test file.

data-dojo-props:'onClick:function(){ console.log("clicked simple"); }, iconClass: 'plusIcon', value: 'Create' "

should be:

data-dojo-props:"onClick:function(){ console.log('clicked simple'); }, iconClass: 'plusIcon', value: 'Create' "

comment:2 Changed 9 years ago by bill

Resolution: invalid
Status: newclosed

Right, please reopen if there's still an issue after fixing the quotes.

data-dojo-props and data-dojo-types also need quotes or otherwise it's a subtraction of three variables.

comment:3 Changed 9 years ago by youngho

Resolution: invalid
Status: closedreopened

Sorry I should be reopen again,

After fixing the typo data-dojo-props: "... ", Still it doesn't work at all.

comment:4 Changed 9 years ago by bill

OK, please attach the updated testcase.

Changed 9 years ago by youngho

Attachment: parser_fail.html added

typo fixed test file

comment:5 Changed 9 years ago by youngho

Hello Bill,

I updated the test file.

comment:6 Changed 9 years ago by bill

Your test file is still invalid, as I said above data-dojo-props and data-dojo-types also need quotes or otherwise it's a subtraction of three variables.

Changed 9 years ago by youngho

Attachment: parser_fail.2.html added

2nd fixed test file

comment:7 Changed 9 years ago by youngho

Hello Bill,

Sorry for missing your comment. I updated again my test file.

comment:8 Changed 9 years ago by bill

Owner: changed from bill to dante
Status: reopenednew

OK that's better, it's syntactically valid javascript. But from the code it looks like instantiate() expects a hash for it's mixin parameter like:

this.instantiate(myNodes, {
   "data-dojo-type": "dijit.form.Button",
   intParam: 5,
   stringParam: "hi"
})

As to what API makes sense, that's up for debate. Is the above API inconvenient for you? It does seem weird compared to how parser works declaratively.

comment:9 Changed 9 years ago by youngho

Also in IE8, the custom className didn't set at all. With FF, I can see the custom class name on the widget, but IE8 it didn't.

I attached another test file for that.

Changed 9 years ago by youngho

Attachment: parser_fail_IE8.html added

IE8, the custom class name didn't set at all

comment:10 Changed 9 years ago by bill

That test is invalid because it's using "className" instead of "class" (note that you need quotes around "class" since it's a reserved word"), but if you still have problems after fixing that please open a new ticket about it.

comment:11 Changed 9 years ago by youngho

I confirme test parser_fail_IE8.html is wrong. After bill's suggestion applied, IE8 works correctly.

comment:12 Changed 9 years ago by dante

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.