In my Sencha Touch 2 application I have an HTML table in a view which has its ID. What I'm trying to do is do some actions, load store, create another table and append it to the existing table - without changing the view. I have no problems with making the request, creating the second table on the fly, etc, however I need to figure out how one table can be appended to another in terms of Sencha Touch? Is there an "appendTo()" function like, say, jQuery has and how can I use it? I basically need to get the table by its ID and append the new table to it. But don't know how to do that in Sencha Touch 2. Any help is greatly appreciated.
Thank you.
It depends what your view extends but if it's extending an xtype:panel then you can use getHtml() to get the existing content and then setHtml() to update it.
Related
I am using Yii 1.1.16 for one of my projects.
I have 5 controllers at the moment, and their data is coming from their respective models.
Now I want to add new functionality into my website, regarding comments. I want to add a form at the bottom of each view, but obviously the data will be coming from another database table (I have created a new model for that).
I am confused. Should I create 5 different forms in HTML for my problem, or can I use Yii widgets functionality to implement the same?
The Comment table would be the same for every user in the database. Comments will be coming with the help of their user id, which is stored in the table, and their comment will be inserted with the help of their user id, too.
Please let me know the best solution you can think of.
I suggest to create one widget for displaying comments section and one controller for handling request from this widget (for example adding new comment or displaying different page of comments list). In this way adding comments for any section should require only few lines of code to initialize widget:
$this->widget('CommentsWidget', [
'parentId' => 'page-' . $model->id,
]);
Good day! I'm still in the process of familiarizing MVC 4 and I have this project in which I have a ParkingLotController which it suppose to have 1 Create view which is an application form and 1 combined Create and Details view where I can View the datas from the application form and add datas by the use of the create function.
(Edited)
Sorry I forgot mention that I haven't done it yet. what i'm asking is, is it possible to do it? how can i implement the idea? thanks!
is there a simple way of creating a list with editable elements (add/remove) on a page?
Something simillar to the users managing list, where you can add and delete users.
For example, you got a table in DB with 2 columns - "Name" and "Value", and rows like
"Onion"-"10" and "Potato"-"20". The idea is to display the table on a page and make it editable.
Sounds simple but im new in Yii, just yesterday learned about it, did first app and other stuff from guides, but there is no guide how to create things like that manually (so far i was installing widgets mostly)
Thanks
The component you need is CGridView. Take a look to this website.
Yii Playground
I have the following layout to my code
However when I hit Delete it does not delete the Table Header View. Is there a way to do this? I have been unable to find out how and there is very little on how to create a GUI from pure code without using IB.
Found out a work around in trying to make a Sidebar like in Finder I first used NSOutlineView however if you use NSSourceList it is without the table header.
I'm newbie in CakePHP and I have a few questions.
I'm trying to set up my first CakePHP website, and I want to display menu with links in my layout. I've created model called MenuItem, then I've created controller "MenuItemsController" and then a function show. When I access /menuitems/show/ all my links are displayed. So here's the problem. I want do call this controller in my layout so links will be visible on every subpage. First question is how to call this controller, and second how will output look like ? Do I have to create view for this cotroller if I don't want to use /menuitems/show/ or it's okay to set controller to output just array of data ?
Thank you!
First question is how to call this controller, and second how will output look like ?
Use requestAction() to request the data from the view OR better, set it based on the page you're on in your AppController::beforeFfilter() method.
In your layout simply use an element $this->element('menu'); and use the set data in it or, if you go for requestAction() do this call inside the element, you can even cache the element.
Read the links to the CakePHP book in the text, the book contains example code as well.