@boikom

@boikom

Forum Replies Created

Viewing 15 posts - 736 through 750 (of 929 total)
  • Author
    Posts
  • in reply to: Dynamically add new data bound elements and variables #100466
    admin
    Keymaster

    I have tried doing things in the following order

    1. Construct Smart.App object with blank parameter (aka {})
    2. Inject new span with double bracket into body after page load
    3. Set data value

    It does not appear to replace the value contained in double brackets — it just continues to display the double brackets.
    Adding the data value before the span has been injected, but after page load, does not appear to have any difference.
    In addition, swapping the order of steps 1 and 2 appears to cause the entire page to blank out, including elements unrelated to the operation.

    in reply to: Dynamically add new data bound elements and variables #100465
    admin
    Keymaster

    Hi,
    smart-model is compatible with sub-property binding and we have demo about that: https://www.htmlelements.com/demos/framework/sub-property-binding/.
    It is also possible to dynamically add additional objects to app.data.
    For example:

    window.onload = function() {
    const app = new Smart.App(
    {
    data: {
    details: {
    subject: "About Transaction",
    message: "Hey, Peter. Take a look at the items, I sent you earlier."
    }
    }
    }
    )
    app.data.test = 'test';
    }

    HTML

    	<div class="demo-description">
    TextBox and MultilineTextBox are bound to sub properties.
    </div>
    <br/>
    <smart-text-box smart-model="details.subject" id="textBox1"></smart-text-box> <br/><br/>
    <smart-multiline-text-box smart-model="details.message" id="textBox2"></smart-multiline-text-box>
    <br/>
    <span>{{details.subject}}</span>
    <br/>
    <span>{{details.message}}</span>
    <span>{{test}}</span>

    Demo: https://codepen.io/boyko-markov/pen/NWWvBRx?&editable=true
    If it is array and you add it like that:

     app.data.array = ['hi', 'bye'];

    in HTML you can refer it like that:

    	<span>{{array.0}}</span>

    Best Regards,
    George
    Smart HTML Elements Team
    https://www.htmlelements.com

    in reply to: Change tab title #100463
    admin
    Keymaster

    Hi Starlight Sparkle,
    the newly added item via the “addNewTab” button always has a label of “New Tab” and it’s not possible to change that via API. However since the new item becomes the selected item by default you can accomplish the same result by binding to the change event and calling update method on it. Here’s how to do it:

    
    document.querySelector('smart-tabs').addEventListener('change', function (event) {
            const newTabIndex = event.detail.index;
            //Get all tab items inside the element
            const allTabItems = this.querySelectorAll('smart-tab-item');
            //Update the label
            if (allTabItems[newTabIndex].label === 'New Tab') {
                this.update(newTabIndex, 'New Custom Label');
            }
        });
    

    Best Regards,
    Christopher
    Smart HTML Elements Team
    https://www.htmlelements.com

    in reply to: Change tab title #100458
    admin
    Keymaster

    Damn, can’t believe I missed that in the documentation. Sorry and thanks!
    But on a related note, is it possible to set the default label that will be used by new tabs created through the built-in “new tab” button?

    in reply to: Change tab title #100448
    admin
    Keymaster

    Hello Starlight Sparkle,
    Thank you for your interest. The proper way to update a tab item’s label and/or content is by calling the method update. Here is an example of setting only the title:
    document.getElementById('tabs').update(0, 'Updated title');
    If you wish to change the content, too, pass a third argument, e.g.:
    document.getElementById('tabs').update(0, 'Updated title', 'Updated content');
    Here is also a demo that showcases this method among others: https://www.htmlelements.com/demos/tabs/insert-remove-update/.
    Best regards,
    Dimitar
    Smart HTML Elements Team
    https://www.htmlelements.com

    in reply to: grid appearence showRowNumber not working in 4.5>= #100446
    admin
    Keymaster

    Hi cetinsert,
    Since you are using this product for months now. Could you share your license key, please?
    Best Regards,
    George
    Smart HTMLElements Team
    https://www.htmlelements.com

    in reply to: grid appearence showRowNumber not working in 4.5>= #100445
    admin
    Keymaster

    Indeed, changing showRowNumber to showRowHeaderNumber works.
    This must have been a simple oversight in your packaging or htmlelements.com demos might have been revised since 4.6 was published.
    Thank you for your prompt response!

    in reply to: grid appearence showRowNumber not working in 4.5>= #100444
    admin
    Keymaster

    https://www.htmlelements.com/demos/grid/row-headers/
    has showRowHeaderNumber.
    Please consult your own resources before responding to ensure an informed answer.

    in reply to: grid appearence showRowNumber not working in 4.5>= #100443
    admin
    Keymaster

    What is the current recommended solution for displaying row numbers?
    /demos/grid/row-headers/ are still distributed with 4.5 and 4.6.

    in reply to: grid appearence showRowNumber not working in 4.5>= #100442
    admin
    Keymaster

    Hello,
    Such Grid property is not available in the current version. This is by design.
    Regards,
    George
    HTML Elements Team
    https://www.htmlelements.com

    in reply to: Custom angular components not rendered in panel content #100436
    admin
    Keymaster

    Hi mgndzz,
    Have a look at this topic Angular Dynamic Component Loading. It demonstrates how to load Dynamic Angular Components with our smart framework. If that doesn’t help you out you can export your angular component as a custom element and use the custom element.
    Best Regards,
    Christopher
    Smart HTML Elements Team
    https://www.htmlelements.com

    in reply to: Reduce size of titlebar #100361
    admin
    Keymaster

    Hi mk_dir,
    The size of the Window header is controlled by a CSS variable. In order to change the size simply set the CSS variable like so:

    
    smart-window {
      --smart-window-header-height: 30px; /* The default size is 50px */
    }
    

    Our themes do not affect the sizes of any of the elements. They only define their colors.
    Best Regards,
    Christopher
    Smart HTML Elements Team
    https://www.htmlelements.com

    admin
    Keymaster

    Hello jtara,
    We are unable to reproduce such issue. If you encounter an issue in your application, then please share codepen example, which demonstrates it.
    Regards,
    George
    Smart HTML Elements
    https://www.htmlelements.com/

    admin
    Keymaster

    OK, now I tested my grid which is used to display a summary of rows added to a database one by one.
    That is, a user fills a form, the form is sent to a server with Ajax, and the Ajax response sends back a row with generated ID, etc. then the row is added to the grid.
    This works only if the grid is first populated with one dummy row. I no longer need to add at least TWO dummy rows. And there no longer (in 4.5) is an issue where only the first 3 rows added show.
    The issue now is that if the grid starts out empty, the rows that I add are not shown.
    So, it is still not completely solved.
    I will now submit a support request for this.

    admin
    Keymaster

    Actually, I need to do a bit more testing, which I will do before submitted a support request.
    I have a grid that I populate from an Ajax request. It populates with a modest number of rows > 3 That’s the one that I tried, and I noted that if the grid starts out empty, then it will never show.
    I haven’t yet tested if there is still some dependence on number of rows added – e.g. previous behaviour is first 3 adds would show, and after that no more.

Viewing 15 posts - 736 through 750 (of 929 total)