Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Event not firing

Hi Aenas.

I've tried following code and it's seem to be ok:

pre

Apperyio("mobilecollapsblock_25").bind( "collapsibleexpand", function( event, ui ) {
var currentElement = jQuery(event.target);

Code: Select all

 alert('Expand1 = ' + currentElement.find('[name="mobilecollapsblockheader_26"]').text());  
 event.stopPropagation(); 

} );

Apperyio("mobilecollapsblock_28").bind( "collapsibleexpand", function( event, ui ) {
var currentElement = jQuery(event.target);

Code: Select all

 alert('Expand2 = ' + currentElement.find('[name="mobilecollapsblockheader_29"]').text());  
 event.stopPropagation(); 

} );

/pre

So, please check whether you set correctly header component name in this code.

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

Thanks for your help and now for a weird one. After managing to get the event to work I added this code which needs to remove the last 5 characters from the end of the header text.

Apperyio("collapseMessages").bind( "collapsibleexpand", function( event, ui ) {
var currentElement = jQuery(event.target);

var read=currentElement.find('[name="lblMsgRead"]').text();

Code: Select all

 if(read==='false'){ 
    //remove (NEW) from subject 
    var subj =currentElement.find('[name="headermsgdate"]').text(); 
    var subjlen=subj.length; 
    var newsubj=subj.substring(0,subjlen-5); 
    currentElement.find('[name="headermsgdate"]').text(newsubj); 

 } 

 //event.stopPropagation();  

});

Here are the before and after event screenshots.
Image

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

UPDATE: If I add a label to the header and update that instead it works

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Event not firing

Aenas,

Why did you coment this line of code?:

pre

//event.stopPropagation();

/pre

Please uncoment it and try again.

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

I uncommented but same result.

Another quick question on mapping data from a json dataset. On mapping I am writing the Read field (true/false) to a localStorage variable(msgRead) to use to combine with the subject field using this js

if(localStorage.getItem('msgRead')==='false'){
return value + '(NEW)';
}
else
{ return value;}

The 'NEW' string is being added to the next record and not the current one as it should. How can I change this behaviour? Is there a way to reference another field in the same dataset instead of writing to a localstorage var?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Event not firing

Hi Aeneas,

As for a collapsible block, are the any console errors when you are running the code?

As for a localStorage variable, add your label to a collaplible block and hide it (use parameter "visible" in Propeerties panel).

Add mapping to this label instead of locaStorage, then read it this way:
prevar text = $(this).parent().find("[name=labelName]").text();/preWhere labelName is a name of the label.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

I have a label within the collapsible called lblMsgRead which I am passing the read field to. The below is the code I've tried in the mapping to the collapsible header label as suggested but for both I'm getting nothing for each of these alerts.

alert($(this).parent().find("[name=lblMsgRead]").text());
alert($(this).find("[name=lblMsgRead]").text());

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Event not firing

Hi Aeneas,

Please give us your app public link.

And describe what do you want to implement. And what does not work.

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

Hi Yurii,

I shared my link with your support team yesterday.

What I am trying to do is quite simple in that I have a dataset of messages going to a collapsible. If the read field is false I want to add "(NEW)" to the subject on mapping. The subject is in the collapsible header. I have tried writing the read field to local storage variable and using it in the mapping of subject but that adds it to the next record. I then tried adding a hidden label item and mapping to it as suggested by Katya but that also did not work.

Let me know if you need anything else.

Thanks,
Aeneas

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Event not firing

Hi Aeneas.

Sorry for late answer.

I've tested your message page(called "main") and can not reproduce your problem.

See details here: http://prntscr.com/3xsein/direct

Thus we need your details steps to reproduce the problem.

Regards.

Return to “Issues”