Kendo sortable interference with input focus

Utilizing both kendo listview and grid components to display the same information in different views; a primary listview of cards and a table-based grid view, both integrated with the Kendo Sortable widget. The objective is to enable users to edit an inline element within the grid view - clicking on a span element displaying the current value should hide it and reveal an input field in its place. This feature functions correctly within the card listview. However, when the input field type is specified as number (determined by the 'data-value-id' attribute), issues arise. One click on the default arrows associated with the number input field causes the field to lose focus prematurely. Clicking outside the input field does not rectify this issue, requiring the user to click back into the input field to regain focus. Only then can pressing the enter key or clicking away from the input field successfully deactivate it.

<span class="single-value">
<input data-bind='value: e.data.Value, visible: Editing, attr: { data-value-id: e.data.ID, type: ValueType }, events: { blur: saveInput, keyDown: valueKeydownHandler }' /></span>        

<span class="data-value-editable" data-bind='click:editSingleValue, invisible: Editing, css: { data-value-editable: Editable }'>

<span data-bind='text: e.data.Value'></span>
</span>

Both components share the same input dataSource. I have discovered that the 'data-value-id' attribute must be distinct for each component, but aside from that requirement, they are identical. Why do the increment/decrement arrows on the input field work properly in the list view but not in the grid view when using Kendo? It seems there were previous issues with the Kendo Sortable component preventing input fields from losing focus, which I resolved by destroying the component. However, this caused problems with the grid view since it was not initially initialized with the Kendo Sortable component and would throw undefined errors on attempting to destroy it. To overcome this, I initialized the grid with Sort, yet now the arrows cause the input field to lose focus. Prior to this modification, I encountered the opposite problem in the list view, where the Sortable functionality prevented the input field from losing focus.

Answer №1

After trying to find a solution using a grid, I ended up having to refactor the component to utilize a Kendo Listview. This meant completely revamping the UI, but in the end, it was worth it given the time spent troubleshooting. The Kendo Sortable functionality posed its own challenges, requiring me to implement the sorting feature on the new list view with disabled functionality to ensure synchronization between both views. Moreover, I had to ensure that the input field on the new list view remained focused with its unique data-value-id attribute so that clicking on that particular view would direct focus to its corresponding input field rather than the expanded list view's input field.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue: $injector:unpr Unrecognized Provider DataServiceProvider (a provider that has not been defined before)

Encountering this issue: Error: [$injector:unpr] http://errors.angularjs.org/1.5.6/$injector/unpr?p0=DataServiceProvider%20%3C-%20DataService%20%3C-%20SignupController Suspecting that the problem lies in the fact that DataService cannot be found due to ...

Table order is requested, but the index fails to comply

I am facing an issue with sorting and deleting data from a JSON table. Even after sorting the columns, clicking "Delete" removes the wrong entry because the $index is not updated properly. Here is the JavaScript code I am using: $scope.friends = ...

Display radio options when clicked upon

I am in the process of creating a set of radio buttons that will be utilized for capturing values to generate a subscription/modal checkout. My current situation involves having the radio button options visible. However, I aim to achieve a functionality wh ...

Is your custom login form in Web2py not submitting properly?

My attempt to customize the login form for web2py has hit a roadblock. Despite adding the necessary fields and submit button, nothing seems to be happening. Here's what the code in the form's view looks like: {{include 'web2py_ajax.html&apo ...

The nested promise.all function is executing synchronously instead of asynchronously as anticipated

Within the nested Promise.all section of my NodeJs script, I believe there is an error. The script is designed to process multiple .csv files within a directory, creating a database record for each row. If a row fails processing, it is added to a list of f ...

elevate and descend div

I am looking to create a div with interchangeable content items. After doing some research on Google, I came across this helpful link: http://jsfiddle.net/RrbzM/4/. In the fiddle, each number can be clicked to move the content up and down. However, I only ...

Locate Checkbox by its Attribute Name and Value

On my webpage, there are multiple groups of checkboxes. In one particular group, I have added a custom "documentcategory" attribute to each checkbox. My goal is to identify all the checkboxes on the page that have the "documentcategory" attribute with a va ...

"Maximizing Data Interaction: The Integration of PHP and AngularJS

I have been developing an AngularJS App alongside a PHP RESTful API for the Backend. I am currently brainstorming about the most effective approach to harness the power of 2-Way Data Binding in AngularJS with my specific scenario. As an illustration, I ha ...

With FullCalendar, users have the flexibility to set end times for events when creating them

Can the user be given the option to set the start and end time of an event, rather than defaulting to 1 hour? I would like the user to have the flexibility to define events for as little as 10 minutes or more. Cheers Steve ...

Reset functionality for input selector is malfunctioning

My HTML code looks like this: <input type="number"> <br> <input type="number"> <br> <input type="number"> <br> <button>+</button> In my JS script, I have the following: $('input').on('c ...

Next.js allows you to create a single page that corresponds to the root path '/' as well as a dynamic route '/param'

I have a single-page website built with Next.js. The home page, which displays a list of products, is located at route / and the corresponding code can be found in pages/index.js. Each product has an id, allowing users to jump directly to it using /#produc ...

Once the page is refreshed, the checkbox should remain in its current state and

I have a challenge with disabling all checkboxes on my page using Angular-Js and JQuery. After clicking on a checkbox, I want to disable all checkboxes but preserve their state after reloading the page. Here is an example of the code snippet: $('# ...

Styling tooltips using only css - Dealing with overflow issues

What is the best way to effectively showcase these tooltips? When using overflow visible, the issue is resolved, but it causes other elements to spill out of the div. How can this be addressed? HTML: <div id="test"> <a title='Sample tooltip& ...

Is it possible to customize the background color for particular days in FullCalendar?

How can I set background colors for specific days? While experimenting, I discovered this method: $('.fc-day15').css('backgroundColor','black'); The only issue is that the colors appear on the 16th day in the calendar grid, ...

Can the combination of a JavaScript frontend and NodeJS backend function effectively together in this scenario?

I have a Domain-A that serves as a static site on Netlify, offering shopping cart functionalities. On the other hand, I have Domain-B hosting a backend server running a Node.JS payment system and utilizing Auth Services through passport.js. Due to its na ...

Clear Vuex state upon page refresh

In my mutation, I am updating the state as follows: try { const response = await axios.put('http://localhost:3000/api/mobile/v3/expense/vouchers/form_refresh', sendForm, { headers: { Accept: 'application/json', 'C ...

Unable to display the string following a space in the value attribute of an hbs file

<input type="text" class="form-control" id="exampleInputEmail2" name="productName" value={{product.productName}} > When I input 'Smart Phones' into product.produc ...

What could be causing my page to appear off-center?

Hey there! I'm still learning the ropes, but I could really use a hand with this issue: So, while I was playing around with HTML and CSS, I wanted to create a page with a fixed size that would be perfectly centered on the screen. My approach was to p ...

Tips for arranging HTML elements in a horizontal line, even if they belong to different parent elements

My HTML document features a sticky header and footer, with a div below the header that sticks to it to eventually hold tabs above a form. I've been struggling to align the form vertically below this div. The issue arises because the tab div lacks a sc ...

I am experiencing difficulty locating the style.css file within my Node.js/Express application

I am currently working on a Node.js/Express app and I'm facing an issue where my browser is unable to find my style.css file, even though I am using a static file. Here is the directory structure: public -> css -> styles.css server -> serv ...