In HTML tag 'input type = number' is not very user friendly. So, I always implement it as a text with transformation text to number.
(read more...)In HTML tag 'input type = number' is not very user friendly. So, I always implement it as a text with transformation text to number.
(read more...)DataGrid looks like a table, but it's another component, it consists of multiple div-elements. But for a user it's a table and common table attributes are often required. One of them is striped rows. Below there's an example how to implement it.
(read more...)If you use a Pro version of Material UI, then you have a tool, how to switch the cells in the DataGrid table. But if you work with a wide table and you just want to make it more comfortable to work with it, there are some tricks for that. The first thing is to 'freeze' the header, so user can collate the column and headers. All the Excel users like this function. And the second thing is to allow user scroll the page if he has a small resolution and he doesn't have touch screen.
(read more...)Obviously, it's an ordinary case, when you get an array of objects and you need to create for the reply the array of other Objects, but you need to initialize it on load. For React developers it can be often used with useEffect or componentDidMount.
(read more...)Obviously, true developers prefer to return the date in a digital format, for example, '24.01.2024', '24-01-2024' and various combinations of this. But customers often want to work with human dates. In this post you can find how to return the custom localized date and how to use it with a Fluent-UI component DatePicker.
(read more...)Sometimes you need to get the parameters and values from the query string in your JavaScript/TypeScript applications. If you don't want to spend the time on making your own methods, you can use this one with URLSearchParams.
(read more...)While the developing, especially while the code cleaning, you often want to know if your method is used or not. It’s usually when you make some temporary methods to determine the optimal one. Visual Studio shows the reference count by default, but Visual Studio Code doesn’t do that. But it’s very useful. Here is how to turn it on.
(read more...)We have a string with an URL. And we want to get the host URL. I don't know about the built-in functions for this and I don't think that you should find external libraries for this. Although, it's a good idea to create your own personal class.
(read more...)A JS/TS useful snippet to return only several last records with sorting by time. The data is stored in localStorage. I can't modify the types for external component, so that's why all the data has string types. and I use 'moment' to convert the strings to the date format.
(read more...)I used EventCalendar component with resources and timeline view, the default interval is 1 month, I also add week numbers to the header. I wanted to fit the calendar to the page without horizontal scroll.
(read more...)