Custom components for numeric textbox in kendo react grid

1 Answer 86 Views
Grid NumericTextBox
Abhishek
Top achievements
Rank 2
Iron
Iron
Iron
Abhishek asked on 04 Mar 2024, 05:11 PM | edited on 04 Mar 2024, 05:15 PM

I have a feature to add display a numeric textbox in the grid while doing in-cell editing. & it depends on a checkbox value.  If the check box in another column is  selected then only the the numeric textbox should be editable in. Kindly help me with a numeric textbox as a custom component in incell grid editing.

I tried to create a numeric textbox as custom component. But i am facing couple of issues.

1)If i add the editor as numeric then the checkbox condition is not matching.

2)if i add editor as text, the cursor in the numeric textbox is not showing if i tryto add more than 1 digit.

                                                                            <GridColumn

width='120px'
field='Max'
title='Max'
columnMenu={ColumnMenu}
headerClassName={
isColumnFiltered(Max')
? 'filter-active'
: 'filter-inactive'
}
editable
cells={{
edit: {
text: MaxRecurring,
},
}}
editor='numeric'
/>

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 06 Mar 2024, 09:35 AM

Hello Abhishek,

If you are losing the focus of an editor you need to make sure that you are defining all custom cells outside of the main component (not inline). As for conditionally rendering an editor, the "editor" type is explicitly set by the developer, which means that you need to set that explicit editor in the "cells" property. Within that custom component, you can then conditionally render different content of the cell based on the props.dataItem.

Here is an example with a custom NumericTextBox:

If further assistance is needed, please modify the example to demonstrate the exact issue that you are facing. 

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
Grid NumericTextBox
Asked by
Abhishek
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or