We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Set value tile badge

Hi,
I used thi code to insert a tile:

@Html.EJ().Tile("tileClienti").ShowRoundedCorner(true).Badge(b => { b.Enabled(true).MaxValue(20).Position(TileBadgePosition.TopRight); }).ImageClass("tileClienti").TileSize(TileSize.Medium).Text(PLV.Web.Resources.Menu.Clienti).ClientSideEvents(c => c.mouseDown("GoClienti").Create("SetBadgeClienti"))



SetBadgeClienti = function (args) {
        var actionUrl = '@Url.Action("SetBadgeClienti", "Admin")';
        $.ajax({
                url: actionUrl,
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                type: 'POST',
                success: function (d) {
                    if (d.success) {
                        args.model.badge.value = d.value;
                    }
                },
                error: function (e) {
                }
            });
      
    }

I tried to use the "Create" method to set the badge value, but the displayed value is always the minimum value. 
How can I dynamically update this value?


9 Replies

AB Ashokkumar Balasubramanian Syncfusion Team July 10, 2019 01:18 PM UTC

Hi Pio Luca Valvona, 
 
Greetings from Syncfusion support. 
 
We were able to replicate your reported problem at our end. The reported problem due to improperly set our component value on run time. Could you please check the below modified code block? 
 
function SetBadgeClienti(args) { 
    var actionUrl = '@Url.Action("SetBadgeClienti", "Admin")'; 
     $.ajax({ 
                url: actionUrl, 
                contentType: 'application/json; charset=utf-8', 
                dataType: 'json', 
                type: 'POST', 
                success: function (d) { 
                    if (d.success) { 
                        this.option("badge", { value: 12 }); 
                    } 
                }, 
                error: function (e) { 
                } 
            });         
    } 
 
If you want to dynamically get or set the properties in Syncfusion components, please follow the below help documentation. 
 
 
Please check the above provided code block and get back to us, if you require any further assistance. 
 
Regards, 
Ashokkumar B. 



PL Pio Luca Valvona replied to Ashokkumar Balasubramanian July 10, 2019 05:01 PM UTC

Hi Pio Luca Valvona, 
 
Greetings from Syncfusion support. 
 
We were able to replicate your reported problem at our end. The reported problem due to improperly set our component value on run time. Could you please check the below modified code block? 
 
function SetBadgeClienti(args) { 
    var actionUrl = '@Url.Action("SetBadgeClienti", "Admin")'; 
     $.ajax({ 
                url: actionUrl, 
                contentType: 'application/json; charset=utf-8', 
                dataType: 'json', 
                type: 'POST', 
                success: function (d) { 
                    if (d.success) { 
                        this.option("badge", { value: 12 }); 
                    } 
                }, 
                error: function (e) { 
                } 
            });         
    } 
 
If you want to dynamically get or set the properties in Syncfusion components, please follow the below help documentation. 
 
 
Please check the above provided code block and get back to us, if you require any further assistance. 
 
Regards, 
Ashokkumar B. 


Hi Ashokkumar,

thanks for the support, but the indicated change does not work. 
This is the error message: Object doesn't support property or method 'option'.


AB Ashokkumar Balasubramanian Syncfusion Team July 11, 2019 11:46 AM UTC

Hi Pio Luca Valvona, 
 
Thank you for sharing your error details. 
 
The reported problem due to access the Tile instance in corresponding code block. So, we have modified our provided code block, please find it below. 
 
function SetBadgeClienti(args) { 
        var obj = this; 
        var actionUrl = '@Url.Action("SetBadgeClienti", "Admin")'; 
        $.ajax({ 
                url: actionUrl, 
                contentType: 'application/json; charset=utf-8', 
                dataType: 'json', 
                type: 'POST', 
                success: function (d) {                
                    if (d.success) { 
                        obj.option("badge", { value: 12 }); 
                    } 
                }, 
                error: function (e) { 
                    obj.option("badge", { value: 12 }); 
                } 
            }); 
    } 
 
Please check the modified code block and get back to us, if you require any further assistance on this. 
 
Regards, 
Ashokkumar B. 



PL Pio Luca Valvona replied to Ashokkumar Balasubramanian July 12, 2019 10:56 AM UTC

Hi Pio Luca Valvona, 
 
Thank you for sharing your error details. 
 
The reported problem due to access the Tile instance in corresponding code block. So, we have modified our provided code block, please find it below. 
 
function SetBadgeClienti(args) { 
        var obj = this; 
        var actionUrl = '@Url.Action("SetBadgeClienti", "Admin")'; 
        $.ajax({ 
                url: actionUrl, 
                contentType: 'application/json; charset=utf-8', 
                dataType: 'json', 
                type: 'POST', 
                success: function (d) {                
                    if (d.success) { 
                        obj.option("badge", { value: 12 }); 
                    } 
                }, 
                error: function (e) { 
                    obj.option("badge", { value: 12 }); 
                } 
            }); 
    } 
 
Please check the modified code block and get back to us, if you require any further assistance on this. 
 
Regards, 
Ashokkumar B. 


Hi Ashokkumar,

thanks for the support,
I no longer get the error but the value no updates is always shows the minimum value set.


AB Ashokkumar Balasubramanian Syncfusion Team July 15, 2019 11:36 AM UTC

Hi Pio Luca Valvona, 
 
We have checked this problem at our end. But our provided code blocks, works properly at our end. Could you please check the below video and sample? 
 
 
 
Could you please ensure whether you are able to access Tile component instance in create event? 
 
Still issue persists, please share the below details. 
 
a.     Package version 
b.     Browser details 
 
Please check the above provided sample and get back to us, if you require any further assistance. 
 
Regards, 
Ashokkumar B. 



PL Pio Luca Valvona replied to Ashokkumar Balasubramanian July 15, 2019 03:21 PM UTC

Hi Pio Luca Valvona, 
 
We have checked this problem at our end. But our provided code blocks, works properly at our end. Could you please check the below video and sample? 
 
 
 
Could you please ensure whether you are able to access Tile component instance in create event? 
 
Still issue persists, please share the below details. 
 
a.     Package version 
b.     Browser details 
 
Please check the above provided sample and get back to us, if you require any further assistance. 
 
Regards, 
Ashokkumar B. 


Hi Ashokkumar,

thanks for the support,

I found that the problem is due to the browser, on MS Edge the code does not work, while tried on Google Chrome the value was set correctly.
How do I extend compatibility to Edge?

Package version:17.2450.0.34


AB Ashokkumar Balasubramanian Syncfusion Team July 16, 2019 02:47 PM UTC

Hi Pio Luca Valvona, 
 
We deeply regret for this inconvenience. 
 
As mentioned in your scenario, Tile value updated properly in Edge Browser at our end. Could you please check the below video? 
 
 
We suspect that, you may be the problem on browser cache. Could you please remove the browser cache and ensure the problem at your end? 
 
Please let us know, If still you are not fulfilling the requirement solutions, we will create the new incident for your account and proceed further. 
 
Regards, 
Ashokkumar B. 



PL Pio Luca Valvona July 16, 2019 03:26 PM UTC

Hi Ashokkumar,

thanks for the support,

assuming that I enabled cache clearing every time the browser was closed, I also did this manually but the result is always the same.

Microsoft Edge 44.17763.1.0
Microsoft EdgeHTML 18.17763


CI Christopher Issac Sunder K Syncfusion Team July 17, 2019 06:58 AM UTC

Hi Pio Luca Valvona, 

Thanks for the update. 

We have created a Direct Trac incident under your account to proceed further on this issue. Please log on to our support website to check for further updates 
 
http://www.syncfusion.com/Account/Logon?ReturnUrl=%2fsupport%2fdirecttrac 

Thanks, 
Christo 


Loader.
Live Chat Icon For mobile
Up arrow icon