JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Data Grid HAVING THE COLUMN CONFIGURATION AS JSON FORMAT

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #104529

    Hi Team,

    I want to know does the CONFIGURATION for the data grid supports the JSON format.

    As we have configuration residing in a separate project which is consumed by the main application.

    An example use case is

    CUSTOM CELL EDITOR: https://www.htmlelements.com/angular/demos/grid/editing-custom-editor/

    <div>
    <div> {</div>
    <div>            label: ‘Mood’, dataField: ”, editor: {</div>
    <div>                template: ‘#moodEditorTemplate’,</div>
    <div>                onInit(index, dataField, editor) {</div>
    <div>                    editor.addEventListener(‘click’, function (event) {</div>
    <div>                        editor.firstElementChild.value = event.target.innerHTML;</div>
    <div>                    });</div>
    <div>                }</div>
    <div>            }, width: 70, align: ‘left’, template: ‘#moodTemplate’,</div>
    <div>        },</div>
    </div>
    In above case, Can I use strings where I can configure Template from my Typescript file . So my configuration works as a JSON format.

     

     

    #104532
    ivanpeevski
    Participant

    Hi Manikanda,

     

    the ‘template’ property can also be set as an HTML string. For example, this will produce the exact same result as the one in the demo:

    template: `<div tabindex=0 style=”padding: 0px; display:flex; justify-content: center;”><span
    tabindex=1>😊</span><span tabindex=2>😐</span>
    <span tabindex=3>😂</span>
    </div>`

     

    Best Regards,
    Ivan Peevski
    Smart UI Team
    https://www.htmlelements.com/

    #104553

    Thanks for the update, In my case i might have different configuration for my clients placed in a separate repository (Ex: Repo A). Also I want to control that in my application which is in another repository (Repo B). For ex: click action, OnInit Events, in these cases I want the configuration to be of JSON format with some Component name as the value for the key in the column configuration (something like that) so that I can have different column config controls(custom cell editor ex: datepicker, where i want to disable future dates). Also I want to perform client side validation when using inline editing . In all these cases, If I have a control on my application(Repo B) it suit my needs, rather than been set on the Column configuration (JSON file) present in Repository A.

    #104566

    Hi,

    You may fetch the JSON and parse it to a plain object. The config cannot be JSON.

    Best Regards,
    Svetoslav Borislavov

    Smart UI Team
    https://www.htmlelements.com/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.