Troubleshooting Floating Divs in ExtJs TreePanel Component

I am currently utilizing the treepanel object in ExtJs and I am trying to implement two divs side by side within the treepanel items. Is it feasible to have one of them set with a fluid width and the other with an auto width? Despite my HTML and CSS codes functioning correctly on their own, they do not seem to work when embedded within the treepanel item's text property. Where could I be going wrong?

Below is a snippet of my Extjs Code:

{
xtype: 'treepanel',
cls: 'wikiTreePanel',
root: {
    text:
    '<div class="treeItemTitleWrapper">'+
        '<div class="countSide"><span>12</span></div>'+ 
        '<div class="titleSide">Main Wiki Title Main Wiki Title Main Wiki Title</div>'+                                         
    '</div>',
    expanded: true,
}}

Here is the HTML and CSS code I have been working with:

.treeItemTitleWrapper{
    display: inline-block;
    width: 100%;
    height: 26px;
    overflow: hidden;
}

.treeItemTitleWrapper .titleSide{
    background: orange;
    line-height: 26px;
    height: 26px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.treeItemTitleWrapper .countSide{
    float: right;
    height: 26px;
    background: pink;
}
    <div class="treeItemTitleWrapper">
<div class="countSide"><span>12121212</span></div>
<div class="titleSide">Main Wiki Title Main Wiki Title Main Wiki Title Main Wiki Title Main Wiki Title Main Wiki Title Main Wiki Title Main Wiki Title Main Wiki Title</div>
</div>

https://i.sstatic.net/RNdrb.png

If you have any insights on how I can rectify this issue, I greatly appreciate your assistance.

Answer №1

It seems like there might be some confusion in your input. Based on my interpretation, if you are looking to shorten the title to a few characters, you can achieve this using the method provided below.

Util.shortenTitle('Example Title', 5);

Util.shortenTitle

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

Trouble arises when attempting to animate the movement of two distinct objects consecutively using jQuery

I am facing an issue with combining animations of two different objects so that the second one starts when the first one ends. I attempted to use a callback function, but it seems I have made some syntax errors that are causing jQuery to crash or behave un ...

The hover effect in CSS animations is turned up too high

Check out my Reddit news feed design: https://codepen.io/Teeke/pen/YxXXaE When hovering over articles, the headlines get displayed. But if the article text is too long, part of the headline may go off-screen. Instead of changing the line-height, I' ...

Utilize external cascading style sheets (CSS) to style XML data loaded into Flash

Trying to incorporate formatted xml into a flash game has been quite challenging for me. Despite my efforts, the css styling doesn't seem to be applied properly. Below is the content of my stylesheet woorden.css: .f {color:red;} This is the str ...

Adding additional text within the paragraph will result in the images shifting backwards when utilizing flexbox

It seems like there might be something obvious that I'm missing here, but essentially my goal is to create a footer with 2 columns and 2 rows. In each column, there will be an icon (32x32) and 2 lines of text next to it. The issue I'm facing is ...

How to perfectly position multiple tables using CSS

I am relatively new to the world of HTML and CSS. I have successfully created several tables, but now I am struggling to display them all on a single line within a designated box. Despite my best efforts, I have not been able to achieve the desired result. ...

How can I delay the loading of a link until the pop-up is closed?

I have successfully implemented a pop-up on my website, but I am facing an issue where I need to prevent any linked pages from loading until the visitor clicks on the accept button. However, I am struggling to make it function as intended. Below is the sn ...

Trigger a function when a button is clicked

This is an ongoing project that includes a calculator and other features. Right now, I am working on a functionality where when you input a number into the calculator results and press "+", it should trigger onClick to check if the input was an integer o ...

Utilizing pure JavaScript to dynamically fetch HTML and JavaScript content via AJAX, unfortunately, results in the JavaScript

I am trying to load an HTML file using AJAX and then execute a script. Here is the content of the HTML file I want to load: <div class="panel panel-body"> <h4>Personal Data</h4> <hr /> <span data-bind="editable: firs ...

Troubleshooting a live chat box for CSS alignment issues

Need help with aligning a live chat box on every webpage? Check out this example for reference: You can find my code here: https://jsfiddle.net/fn77d0de/2/ ...

creating a randomized location within an HTML element using JavaScript

Trying to figure out how to randomly generate a position within an HTML div. I've come up with a JavaScript function that looks like this: function randomInRange(min, max) { return(Math.floor((Math.random() * (max - min) + 1) + min)); } My ...

jQuery is malfunctioning following an AJAX request

Can anyone help me fix an issue with my jQuery code? I have a hidden div that should be shown when the mouse hovers over a sibling element. However, it seems like after my AJAX function is executed, the jQuery stops working. <div class="parent"> ...

Rails and Materialize CSS icons encountering unexpected alignment issues

There's an unusual problem I'm facing with Materialize CSS's icons in a table. They don't align properly. I've attached a screenshot for reference (personal details blurred out). Screenshot Link Below is my Slim template code: ...

Utilize Python to extract information from an HTML table

I am looking to extract data from an HTML table using a Python script and save it as variables that can be later utilized in the same script after loading them in if they exist, into a separate file. Additionally, I would like the script to disregard the f ...

The JavaScript code is not being executed, as the address bar displays the function name instead

In my project, I have created numerous "js-classes" with various functions spread across different files. Unfortunately, the codebase is too large to share entirely. However, towards the end of the project, I encountered a bug where a specific function wa ...

Issue with the JQuery FadeIn effect on my website when a div is repositioned for visibility

I have been working on revamping an existing website at www.gjelavoie.com. To enhance the user experience, I decided to use jquery fadein() and fadeout() functions for displaying my Contact form without visitors having to temporarily access the main page. ...

Adding a disabled internal Style node to the HTML5 DOM: A simple guide

According to this, the style tag can be turned off using the disabled attribute. I attempted the following: <head> <style>body { color: black; }</style> <style disabled>body {color: red; }</style> </head> <bo ...

Place an animated object in the center with the display style set to

I'm trying to vertically center the second span within my H1. After attempting to change from display: inline-block to display: flex, I found that this causes my animation to start at the beginning of the container rather than in the center. I suspe ...

What is the best way to switch between my two images upon clicking?

When I click on an image, it changes to a different image. I achieved this by altering the source of the image upon clicking. Now, my goal is to incorporate a smooth transition between the two images after they are clicked. I attempted to stack the two im ...

Implementing a Jquery check based on a checkbox

Hey, I'm having an issue with a condition. When I uncheck the checkbox, it doesn't uncheck. I've tried to make a block display, but the JavaScript isn't working. I attempted to add: document.getElementById("Reload").style.display = "b ...

Replace character within a table using jQuery

Below is the table content: <table> <tr> <td>"James"</td> <td>"do"</td> <td>"you</td> <td>"like</td> <td>"your life"</td> </tr> </table> <butt ...