This is a migrated thread and some comments may be shown as answers.

Checkbox and text input inside ListBox item template

3 Answers 152 Views
This is a migrated thread and some comments may be shown as answers.
Austin
Top achievements
Rank 1
Austin asked on 05 Apr 2018, 07:41 PM

I know ListBox probably doesn't support this out of the box but I'm really struggling to find a solution to my problem.

I would like to customize the item template to contain a checkbox and a text input when it is moved to the right ListBox. I am able to put a checkbox and input in there no problem but I can't get the textbox to focus when clicked.I would also like to bind its value to the dataItem but I'm sure I can figure that part out once I'm able to actually type in the box.

Here is a Dojo demonstrating the problem:

https://dojo.telerik.com/eZuKoMoh/2

3 Answers, 1 is accepted

Sort by
0
Ivan Zhekov
Telerik team
answered on 06 Apr 2018, 07:46 AM
Hi, Austin.

Listbox is indeed not fit for the task. It's really not designed to do that. Perhaps a listview would be more suited for your needs.

If you could explain what you are trying to achieve, we could recommend a solution.

Regards,
Ivan Zhekov
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Vitaliy
Top achievements
Rank 1
answered on 06 Dec 2018, 07:05 PM

Hi. 
For me it would be useful too.

In my case I need to build control with items like ListBox, so user can additionally add/edit some text property on each item.

My use case - user creates items, which are shown in listbox, then user click on each item ( and focus should be on input) and can edit text.

0
Ivan Zhekov
Telerik team
answered on 10 Dec 2018, 03:33 PM
The closest you can get to listbox with editing is a listview that looks like a listbox, and I've created a quick example of that -- https://dojo.telerik.com/@joneff/oqUkeWud, albeit in kendo-jquery, but the logic should be pretty similar.

The reason to go with listview is because listview has no explicit layout and can be customized to mimic most data driven components. In addition, it has editing templates, which is not something present in listbox. Do checkout the example and fiddle with it. That, hopefully, would give you an idea of what can be achieved and if it indeed fits your case.

Regards,
Ivan Zhekov
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
Austin
Top achievements
Rank 1
Answers by
Ivan Zhekov
Telerik team
Vitaliy
Top achievements
Rank 1
Share this question
or