I am using ExtJS 3.2.1 with Rails 3.x.
I have a Panel on which I want to add ExtJS Buttons “dynamically” depending upon the number of records in the db. I tried googling but no luck.
Any Suggestions?
Thanks in advance !
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It not clear in your question where you are adding the button. Are you adding it into a toolbar or into buttons section of a panel. Either way, you should be able to use the
addButtonmethod available forToolbarandPanel.Now, to create buttons you will have to wrap it in a loop. Before that you will have to get the necessary data from DB. For getting data, you can use the
Ext.Ajaxclass and according to the response, iterate and create the buttons.