Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8602973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:12:55+00:00 2026-06-12T02:12:55+00:00

I am using mobiscroll with underscore. I have an underscore template. I need to

  • 0

I am using mobiscroll with underscore. I have an underscore template. I need to do the .scroller on an element added from the template.

Here is the template:

<form>
    <input type="text" id="startdate" name="startdate"/>
</form>

Here is the render function in the view:

var MyView = Backbone.View.extend({
    template: render('auctioncreate'),
    render: function() {
        this.$el.empty().append(this.template);
        $('#startdate').scroller();  // this does not work
    }
});

render is a function that loads the html and makes it into a template. For completeness, here is the code for the render function:

function render(tn, td) {
    if(!render.tc) {
        render.tc = {};
    }
    if(! render.tc[tn]) {
        var td = 'assets/js/templates';
        var tu = td + "/" + tn + ".html";
        var ts;
        $.ajax({
            url: tu,
            method: 'GET',
            async: false,
            dataType: 'html',
            success: function(d) {
                ts = d;
            },
            error: function(e) {
            }
        });
        render.tc[tn] = ts;
    }
    return _.template(render.tc[tn]);
}

I have tried adding a ondomready javascript in the template itself. It does not work straight away, but it does work after a refresh?!

$(function() {
    $('#startdate').scroller(); // this work if I refresh once.
});

Basically I need to apply the datetime picker on the element after it gets appended to the dom.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:12:56+00:00Added an answer on June 12, 2026 at 2:12 am

    The error was in the render function of the View.

    Instead of:

    $('#startdate')...
    

    It should have been:

    this.$('#startdate')...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using MVC2 I have an AJAX form which is posting to a bound model.
Using Java,I have to fetch multiple sets of values from an XML file to
Using CRM 4, I have an entity form that contains a tab with an
using VB.Net2010 I need to call a C# DLL The problem I have is
Using a populated Table Type as the source for a TSQL-Merge. I want to
Using RestKit 0.10.1, I have objects served similar to this json format: {objects: [
Using System.Diagnostics.EventLog .NET type one can programmatically create logs into the Event Viewer application.
using Telerik.WinControls.Data; using Telerik.WinControls.UI.Export; namespace Directory { public partial class radForm : Form {
Using range() in Underscore I can make something like this: _.range(10); >> [0, 1,
I am pretty new to mobile stuff, jquery... Here is the situation I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.