Click here to Skip to main content
15,886,362 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Looking for team Pin
ashkanpower18-Jun-13 0:49
ashkanpower18-Jun-13 0:49 
QuestionHTML issue with IE. Pin
InderK17-Jun-13 3:17
InderK17-Jun-13 3:17 
AnswerRe: HTML issue with IE. Pin
Richard Deeming17-Jun-13 4:46
mveRichard Deeming17-Jun-13 4:46 
GeneralRe: HTML issue with IE. Pin
InderK19-Jun-13 1:25
InderK19-Jun-13 1:25 
AnswerRe: HTML issue with IE. Pin
Dholakiya Ankit10-Aug-13 1:43
Dholakiya Ankit10-Aug-13 1:43 
AnswerRe: HTML issue with IE. Pin
Dholakiya Ankit12-Sep-13 1:10
Dholakiya Ankit12-Sep-13 1:10 
Questionjquery/jquerymobile - image inside collapsible>listview Pin
Prasoon Chaudhary13-Jun-13 6:57
Prasoon Chaudhary13-Jun-13 6:57 
QuestionjQuery - getting selected item of dynamic listview Pin
Prasoon Chaudhary13-Jun-13 6:13
Prasoon Chaudhary13-Jun-13 6:13 
I am generating a dynamic collapsible-set with listViews using XML data. It's generated correctly, but I need a click/touch event to display some data before it goes to another page. Here is my code:
JavaScript
$("#dvAccordion").empty();
var outdiv = $('<div data-role="collapsible-set"></div>');
$(strXML).find('Category').each(function(){
    var colldiv = $('<div data-role="collapsible" data-collapsed="true"></div>');
    colldiv.append('<h3>' + $(this).find('Category_Name').text() + '</h3>');    
    var uldiv = $('<ul  data-role="listview" data-inset="false"></ul>');
    colldiv.append(uldiv);
    //
    $(this).find('Menu_Item').each(function(){
        var sItemName = $(this).find('item_name').text() ;
        uldiv.append('<li data-name="baby"><a href="menu.html" rel="external">' + sItemName + '</a></li>');                         
    });
    //
    //$('#dvAccordion').listview('refresh');
    //
    outdiv.append(colldiv);
    outdiv.appendTo('#dvAccordion');
});
//$('#dvAccordion [data-role=collapsible-set]').collapsibleset();
//$('#dvAccordion').collapsibleset();
//$('#dvAccordion').collapsibleset('refresh');

$('#dvAccordion').trigger('create');

I am adding an eventListener on page load like this:
JavaScript
$('#dvAccordion ul').children('li').bind('vclick', function(e) {
alert('Selected Name=' + $(this).attr('data-name'));
});


Where am I wrong? If I try to write the same event listner after developing collapsible in static way in html - everything works fine.

jsfiddle - http://jsfiddle.net/yesprasoon/MvcHm/

modified 15-Jun-13 9:41am.

AnswerRe: Free java online course Pin
dusty_dex12-Jun-13 2:15
dusty_dex12-Jun-13 2:15 
GeneralRe: Free java online course Pin
Richard MacCutchan12-Jun-13 2:30
mveRichard MacCutchan12-Jun-13 2:30 
GeneralRe: Free java online course Pin
dusty_dex12-Jun-13 7:02
dusty_dex12-Jun-13 7:02 
QuestionPassing objects byref between html windows Pin
tiwal11-Jun-13 23:30
tiwal11-Jun-13 23:30 
QuestionCalling a function from within a function question Pin
Calufrax1211-Jun-13 14:06
Calufrax1211-Jun-13 14:06 
AnswerRe: Calling a function from within a function question Pin
Dennis E White11-Jun-13 15:40
professionalDennis E White11-Jun-13 15:40 
AnswerRe: Calling a function from within a function question Pin
thanh_bkhn11-Jun-13 15:55
professionalthanh_bkhn11-Jun-13 15:55 
GeneralRe: Calling a function from within a function question Pin
Calufrax1213-Jun-13 15:25
Calufrax1213-Jun-13 15:25 
QuestionEnable / Disable textbox controlled by drop-down menu in PHP Pin
swapnilwebsite11-Jun-13 1:01
swapnilwebsite11-Jun-13 1:01 
QuestionSend Data to ASPX Page Pin
ASPnoob9-Jun-13 4:56
ASPnoob9-Jun-13 4:56 
AnswerRe: Send Data to ASPX Page Pin
Dennis E White9-Jun-13 18:48
professionalDennis E White9-Jun-13 18:48 
QuestionActiveX Object in javascript can not create after host it Pin
kuntala kumari mahanta8-Jun-13 0:38
kuntala kumari mahanta8-Jun-13 0:38 
AnswerRe: ActiveX Object in javascript can not create after host it Pin
Dennis E White8-Jun-13 19:53
professionalDennis E White8-Jun-13 19:53 
GeneralRe: ActiveX Object in javascript can not create after host it Pin
kuntala kumari mahanta9-Jun-13 19:40
kuntala kumari mahanta9-Jun-13 19:40 
GeneralRe: ActiveX Object in javascript can not create after host it Pin
dusty_dex9-Jun-13 22:13
dusty_dex9-Jun-13 22:13 
QuestionPassing Element ID to ASP.net Pin
ASPnoob7-Jun-13 16:31
ASPnoob7-Jun-13 16:31 
AnswerRe: Passing Element ID to ASP.net Pin
Dennis E White8-Jun-13 19:52
professionalDennis E White8-Jun-13 19:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.