-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude first child #116
Comments
Of course I can filter through the items: $('#activities')
.children()
.filter(function (index) {
if ( index !== 0 && index % 2 === 0 ) return $(this);
})
.remove(); But is there any better way to so this? |
Replace all the options with an object content, difference the first element adding the attribute value that will be an option: var activities = [
{activity: 'Choose activty'},
{activity: 'Jogging'},
{activity: 'Gym'},
{activity: 'Sky Diving'}
];
var directives = {
'activity': {
'html' : function(){
return this.activity;
},
'value' : function(){
if(this.activity !== 'Choose activty'){
return this.activity;
}
}
}
};
$('#activities').render(activities, directives ); |
Same issue here. I have this pagination template: <ul class="pagination">
<li>
<a href="?page=-1" class="paginator-page-link-prev">«</a>
</li>
<li class="paginator-page active">
<a href="?page=1" class="paginator-page-link">1</a>
</li>
<li>
<a href="?page=+1" class="paginator-page-link-next">»</a>
</li>
</ul> How can I exclude first and last |
Hi @flaviolaino sorry for delay. DO you have a plunkr with your code to check how It works please, will be useful. |
Still having problems? |
@ivangrimaldo uh? |
I mean did you resolve it? jojo |
@flaviolaino |
@dlibanori can I not capture some element when calling render? How? |
@flaviolaino change your query |
@dlibanori what do you mean? |
@flaviolaino I was thinking that render just valid pages would be easier but I'm wrong. The second option you have is just to render first and last page as one of your data. I can't see why this wouldn't work for you. Actually, I think this should be best option cause you may need to change your |
I need to exclude first option element from select before render().
I have:
JS code is:
The output is:
Of course it's not what i need. I need the following:
Please give me an advise what i'm doing wrong.
Thanks in advance!
The text was updated successfully, but these errors were encountered: