Articles in this section
Category / Section

Why do not use special characters in grid id.

1 min read

We used the JsRender to render grid and the grid id value to name the Jsrender helpers and templates.

So while using the special characters (+,-,>,< and etc) in grid id it will throws an error. Hence we must use only valid JavaScript name characters (a-z, A-Z, 0-9, _, $) as a grid id.

Example:

Please refer the below code snippet, here we have mentioned the grid id as "clients-grid"(which contains hyphen).

 $("#clients-grid").ejGrid({

 });


For example the helper to create alternate row will be named with the grid id as “_clients-gridAlternateRow” and the hyphen inside the JsRender template will be considered as “-” (minus symbol) and hence the error occurred.

In the below code snippet, you can see that the hyphen in the template is considered as minus symbol and the “clients” and “grid” are considered as individual property.

ret+=(v=view.hlp("_clients")-data.gridAlternateRow())!=u?v:””


The similar issue has been discussed in the below link:

https://github.com/BorisMoore/jsrender/issues/146

To resolve this issue, we suggest you to replace the hyphen ( clients-grid”) with the any of the above mentioned valid Javascript name characters (a-z, A-Z, 0-9, _, $) in the grid container id value.

 

Conclusion

I hope you enjoyed learning about Why do not use special characters in grid id.

You can refer to our JavaScript Grid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.  You can also explore our  JavaScript Grid example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied