20,555 questions
0
votes
1
answer
38
views
Strange behavior and rendering on model.set() command
At the beginning, I've added a property to the model:
this.model = new Model()
this.model.set("level","test")
In another routine, I've to refresh this "level" property ...
1
vote
1
answer
56
views
Inserting unique attribute to HML tag element in loop
I have a supersite that uses all kinds of js, including backbone.js and underscore.js. On one of my pages, I have the piece of code below:
<#loop:main_tlds_price_add#>
<tr>
<td ...
1
vote
0
answers
55
views
How does triggers clicked worked in backbone.js
Recently, I have got a rails project project with backbone.js and CoffeeScript to support however I don't have previous work experience with backbone.js.
Some of model relationship of the projects are:...
0
votes
2
answers
61
views
Using javascript template file, how can I check for a null or an undefined value?
I am using a Javascript HTML template engine. How do I check for null or undefined in my HTML?
If ctx.m.transferTicket is null or undefined, I want to treat that as being false.
SO I have this code
{%...
1
vote
2
answers
52
views
Sort Backbone Collection based on a file order list
I have a inherited a system that utilizes a Backbone collection of files that needs to be sorted based on a series of values. The order variable is saved when you slide different files into a position ...
1
vote
0
answers
70
views
GrapesJS builds on macOS but not on Windows 10+
I am hitting a wall on this one. I am building GrapesJS, a web page editor (https://github.com/GrapesJS/grapesjs). It builds fine on macOS but not on Windows 10+. Same version of node, latest release ...
1
vote
0
answers
131
views
Webpack: "SyntaxError: Invalid regular expression flags" during runtime
Webpack 5
Node v18.12.1
Backbone
I'm trying to package a client/server website using webpack (Express.js/Backbone.js) but I get this error during runtime. Not sure where to look for the problem.
[24/...
1
vote
1
answer
36
views
I want to hide div after render call complete in backbone js
I want to hide div based on userId is null or not, I am getting userId from function. After loading html I want to hide one div based on condition.
render: function() {
userId = kf.helper....
1
vote
0
answers
140
views
How to add options to a Select with JQuery (Ninja Forms)
jQuery(document).on('nfFormReady', function() {
var textField = jQuery( '#nf-field-3918' );
var selectField = jQuery( '#nf-field-3962' );
textField.val( 'New Value' ).trigger( 'change' );
...
1
vote
1
answer
35
views
How can I set an attribute on specifically the last child view of a Marionette CollectionView?
I have a Marionette CollectionView with a child view:
const BreadcrumbListView = Marionette.CollectionView.extend({
...
childView: BreadcrumbView,
...
})
const BreadcrumbView = Marionette.View.extend(...
1
vote
0
answers
39
views
Uncaught TypeError: App.Routers.Maintenances.MyRouter is not a constructor
I am using backbone js as frontend in rails 7 application. In index.html file I have called backbone main file. code is coming in this file. But here I have initialise router file. In which getting ...
0
votes
1
answer
160
views
How to trigger an event on a form contained in a modal that updates a user's email address
I am working with an old code-base that has a tech stack of Backbone JS, jQuery, and Bootstrap. I have a bootstrap modal that I am using to update an email address on my server. I can't figure out how ...
1
vote
1
answer
31
views
How to pass data to a View in Backbone.js?
I am trying to pass data to SingleTodo view in Backbone.js. But, it is not passing properly.
For more clarity, please see the code and outputs given below.
Code:
temp.html
<h1>This is Temp</...
0
votes
1
answer
122
views
How to handle server's request for logout confirmation in Backbone
I've got a project comprising a servlet/restlet back end (written in a Java8 framework) and Backbone front end.
The Backbone has a "Logout" button to terminate the user's browser session ...
0
votes
1
answer
76
views
How to customize pagination by hiding numbers
I want to customize the bootstrap-table pagination by hiding numbers and show next, previous,first and last like :
enter image description here
I want to customize the bootstrap-table pagination by ...
0
votes
1
answer
27
views
Understanding Sort and comparator in Backbone.js
I'm trying to understand sort and comparator in Backbone.js. I've seen many answers online but I have been unable to get any of them to work. Working with the jsfiddle of the classic "ToDo" ...
0
votes
1
answer
277
views
How to write simple functions in Backbone.js?
I am working with some legacy website which is using the Backbone.js framework for the frontend. I'm new to the frontend and Backbone.js seems very confusing when compared with simple JavaScript.
...
1
vote
2
answers
64
views
How to turn off hover if on click event is active in Jquery?
I have an icon name tag-icon-arrow i have onclick and hover events on it.
But since i hover over the icon the hover is active and when clicked both are active which i don't want, I know before ...
0
votes
1
answer
64
views
bind attribute in custom event
In SugarCRM (backbone.js) I am trying to get the custom attribute user_id from a list (in .hbs file)
<div class='dropdown usersLegend'>
<ul class='dropdown-menu'></ul>
</div&...
0
votes
2
answers
62
views
what is a backbone.undo.js object/model/collection and how do I register it?
I'm trying to use backbone.undo.js to implement undo and redo function into my html/javascript web app.
I understand that I need to do this
//Instantiate your UndoManager
var undoManager = new ...
1
vote
1
answer
75
views
How to properly describe events in Backbone views with JSdoc?
I am describing JavaScript code that uses the Backbone framework.
I am wondering how to document events that are declared in my views.
Let's say I have a class with this events:
define([], function(...
0
votes
1
answer
418
views
Migration from lodash 3 to lodash 4: what replaces the 'lodash/string/template'?
We try to migrate one Backbone.js project from lodash "3.10.1" to latest lodash "4.17.21" and seems like 'lodash/string/template' was removed in version 4.
In our code we have ...
0
votes
2
answers
67
views
I am trying to sort my collection when I add a new object to it, but it is not sorting and there are no errors
in my Backbone view, a user can add a new educational research opportunity by hitting a button.
Each research opportunity has a sequence in the database and this is how it's ordered on my page.
When I ...
0
votes
2
answers
48
views
How can I tell my javascript to wait until the server is done?
In my web app, I have a page where users can copy books from their library.
On the website, when a user clicks the copy button, the app executes this bit of Backbone.js code:
clonebook: function () {
...
0
votes
0
answers
28
views
How Redirect to another codeigniter controller after submitting data in backbone.js
Ive created a backbone application that sends form data to the codeigniter backend for verification using a MySQL database.
Below is the authenticate event of the backbone view that will be called on ...
0
votes
1
answer
34
views
what is the event name for typing on a textfield on a view in backbone.js?
Ive created a view that displays information about quizzes I got from MySQL database. In order to search for a specific quiz I have implemented a search bar in a new view called MyQuizSearchView. ...
1
vote
1
answer
110
views
View not initializing in Backbone.js
Ive created a simple backbone app that gets data from MySQL database about users to display in a view called LeaderBoardView.
Below is the HTML code for the view,
<body>
<div id="...
1
vote
0
answers
13
views
Data not appending to url when sending through Jquery and Backbone
Ive created a simple backbone.js app to check how it works.
The application lets user search for a book by title in MySQL database.
The application contains a text field and a button as such,
<...
0
votes
1
answer
123
views
Problem trying to access javascript modules inside a Backbone.js view template using Webpack
I'm doing some maintenance on a Java web-application composed of JSON APIs and a UI based on Backbone.js and React, bundled using Webpack.
This application has a single main page, index.html and a ...
0
votes
1
answer
221
views
How to align dropdown button to content in Bootstrap 5?
I am upgrading bootstrap from 4 to 5. I found that data-toggle="dropdown" needs to be changed to data-bs-toggle="dropdown".
My problem is after I did the upgrade one of my dropdown ...
1
vote
1
answer
66
views
My Backbone Routing forgets everything when I hit the browser refresh button
I have an older web app that is a mix of Backbone and .Net 6. When I first start the app in Visual Studio 2022 for development, it loads fine and everything works great.
I use Backbone routing and a ...
1
vote
0
answers
311
views
How to set a default option value for a backbone select in wordpress media library attachment filters?
Wondering if it's possible to trigger a default option for this backbone dropdown in the wordpress media library. I've created a new filter for "years", and it would be great if I could set ...
1
vote
3
answers
4k
views
How can we hide scroll bar arrows but retain the scroll bar in html?
I have html code which shows scroll bar but has the following look and feel
I wish to remove the arrows of up and down but retain the scroll bar . How can this be achieved .
0
votes
1
answer
2k
views
How to create a blob from a base64 string; javascript
Basically what the title says; I have a base64 string that encodes an image and I want to convert it into a blob so I can pass it into my File constructor. I realise many similar questions have been ...
0
votes
1
answer
108
views
how to have template helpers change dynamically? backbone.js
I have a template helpers method in my view like so:
templateHelpers() {
return {
url : this.model.get('url')
};
}
And I use the url variable in my template; However, the URL ...
0
votes
1
answer
158
views
PhpStorm: Highlight Elementor Backbone Templates
Is there a way to highlight Elementor Backbone templates in PhpStorm?
The code is gray and sad at the moment.
0
votes
0
answers
608
views
Scroll area in js
I have a page in js . I wish that whenever I scroll I define how much of the page is scrolled . I don't want that I handle the scroll event , keep a state of old location , detect direction and then ...
1
vote
1
answer
191
views
Underscore.js template variable name is being escaped causing it to not get rendered
I am playing around with rendering templates using with Underscore.js (Backbone.js app). I'm running into the following issue, where a part of the variable name in the template I am trying to render ...
0
votes
0
answers
51
views
Jquery Datatable : navigating to next page throws RangeError
I have limited understanding of Jquery and DataTables and have run into a strange issue. Hoping someone can help me resolve or point me in right direction.
I am using Backbone.js and made an ajax call ...
0
votes
1
answer
43
views
Why is scrolling to top not working html?
I have a html which is a table with left & right side. on left side chapter names exist an on right all chapter content exists . when i click on a chapter on left i wish to see that chapter on top ...
0
votes
1
answer
52
views
Why am I having a problem accessing $el in my view in BackboneJS?
I'm trying to utilize the append method through the el in the BackBoneJS view. I'm using Handlebars.
When I run my code, I get this in the console:
main.js:14 Uncaught TypeError: Cannot read ...
1
vote
0
answers
27
views
Why can't I access the attributes of this BackboneJS model?
I'm new to BackboneJS. I'm trying to build a model and view, understanding how they work as I build them.
If I create my model like this:
const VideoViewerModel = Backbone.Model.extend({
...
0
votes
1
answer
1k
views
"Module not found" when migrating to Webpack 5
I am trying to migrate my React app to webpack 5.72.0 (from 4.42.1). So I also have webpack-cli (4.9.2), webpack-dev-server (4.8.1) and babel (7.17.9).
My problem is as follows. When I build my ...
0
votes
0
answers
27
views
Cross-Origin Read Blocking (CORB) in backbone.js [duplicate]
When I call the function sites.fetch() in the google console this error appears Cross-Origin Read Blocking (CORB) blocked cross-origin response https://api.nutritionix.com/v1_1/search?callback=...
0
votes
0
answers
22
views
Backbone fetch() error when get JSON file from Google-Drive [duplicate]
When use <link rel="stylesheet" type="text/css" href="https://drive.google.com/uc?export=view&id=[stylesheet - ID]"> //True
and use <img class="item-...
0
votes
1
answer
140
views
object is possibly undefined error when trying to declare a variable in backbone model
I am using a backbone model:
export class test = Backbone.Model.extend({
defaults: {
name : ''},
x = 'test'
)}{
function(){
console.log(this.x)}
}
However I get an error on the ...
1
vote
1
answer
79
views
jquery ui datepicker not appearing on click with marionette/backbone
Using marionette and trying to display a jquery date picker. However, when I click on the input, the calendar does not appear.
This is my view:
const view = app.Views.Layout.extend({
template: require(...
0
votes
0
answers
324
views
Handling multiple keydown events on same key one at a time
In my project i have multiple events binded on window escape keydown pressing , and all of them are executed at the same time when escape key is pressed.
I need to make this events to fire only one ...
0
votes
1
answer
25
views
Backbone Model.fetch() - how does it take care of duplicates
As per the backbone js documentation, model.fetch() merges current model's state with server if different exists in the attributes.
Question 1: Is there a way I can tell backbone to overwrite the ...
1
vote
0
answers
21
views
testing backbone.js view anonymous events with jasmine
How can i access click event outside the template scope.
What i have : HTML :
<div class="right_btn"></div>
<div id="template_loader">
<!-- HTML template ...