I'm new to Drupal 7. Right now I'm trying to use D7 to build an interface that allows me to directly manipulate the tables in the database.
I have installed a couple modules such as Data, Migrate, Feeds, and etc. I managed to create a view to display the table that I created using Data Module, but I need to add and update the rows from the interface.
Furthermore, is it possible to set up relational tables so that I can update or delete related rows at the same time using Drupal?
Thanks in advance
Using the data module that is quite easy because it comes with the "Data Entity" submodule that creates an entity form for you. This allows you to update data table rows. It should add an edit button at the end of your data view for the table.
Using some basic custom code you can always create a form to add/update data to the table as well. For form creation please have a look at:
http://api.drupal.org/api/drupal/includes%21form.inc/group/form_api/7
Related
I am creating a kind of excel online application using react in frontend, Java in backend and Postgres database.I am using a library called ag-grid (community edition).
Now one of the feature i need is to copy and paste data in to rows
just as we do in excel.
The grid is going to be linked with the Postgres, all the data in the table in the DB is displayed into the grid and any change made into the grid will be reflected to the DB and vice-versa.
The specific need is, i need copy and paste feature, i need to paste the data which is, say copied from other excel in to my application. I should be able to create blank rows and i should be able to paste the data into those rows, if the blanks rows are less then it rows should get automatically added(as in excel) as soon as data (say multiple rows data) is pasted into a one or more rows.And when i choose to save the my application then data of grid should be saved to DB.
Is it possible to create this feature using ag-grid community ?
Is there any other library which is recommended for this purpose ?
If there is any resource or documentation available for this feature
then please point me.
Just in case if anyone stumbles upon this problem, I've found a solution from some another website. It uses processDataFromClipboard event of Ag Grid for a custom solution.
https://plnkr.co/edit/lM3OtCQxpJdapHQt?preview
The ag-grid community edition does not support CRUD operations with a server side model - the enterprise edition does:
https://www.ag-grid.com/javascript-grid-server-side-model-crud/
If you insist on using ag-grid community you will need to handle the editing/grid changes yourself, which should not be too hard. A good starting point would be the cell editing page:
https://www.ag-grid.com/javascript-grid-cell-editing/
In particular, you will need to listen to the cellValueChanged or rowValueChenged event:
https://www.ag-grid.com/javascript-grid-cell-editing/#event-cell-value-changed
The event params will provide you with the following properties:
newCalue
oldValue
column
colDef
which you can use to generate the update call.
I know that this is more dnn than 2sxc question but I have some custom table inside dnn database and don't know how to do clasic dnn modules and using only 2sxc for module development.
My question is if you can give me some guides what is the easyest way for adding new record in this table from razor script or 2sxc apicontroller (preferred).
It would be the best if someone can paste some sample with code to get sql connection string, dnn database object qualifier and sql with command execution.
I don't need any relationship stuf.
From there I think that I can figured out how to make also edit and delete and post code back that others can see.
I don't plan to use this for many stuf but we have some sensors and aplication with a lotoff events and need custom table I can easy clear and index, and don't want that this data is EAV tabels.
For later I know how to get data back for visualization over sql datasource inside 2sxc.
In the far future we'll create a generic API to store to any kind of repository (EAV, SQL, CSV, Json, etc.) but for now, you'll just have to code it.
Basically your question isn't actually related to 2sxc - I recommend you simply google things like "save data to SQL using WebApi" or something - then put this code into an API controller in 2sxc.
At the moment I don't have any demo-code, but if you do create a demo, I would be glad to blog about it and publish in on https://2sxc.org/en/apps
I am using vb.net WinForms with SQL Server 2014. I have a form with various textboxes and checkboxes I am populating from the database with a BindingSource. The two tables with the relevant info are called Channel and Setup. A setup can have many channels while a channel belongs to one setup. In the setup table I have a field called CurrentSetup which indicates the active setup with a bit. I need to show info only from the channels that belong to the active setup. I tried putting "CurrentSetup='True'" on the BindingSource, but that doesn't seem to work because all my data is coming from the ChannelBindingSource which can only read the foreign key (Setup_id) from the Setup table, but can't access the rest of the table it seems.
So to sum it up, my question is how can I filter a BindingSource based on a field from a related table?
I'd add to that that I'm using the Entity Framework (6), and I've read that BindingSources aren't even the recommended way to do this, but it's the only thing I've found that seems to work so far. If I'm way off base with this, and should be doing something else I'm open to that too. I just still find BindingSources in the current (VS 2013) Microsoft documentation.
If you're using EF then you should be getting only the data you want using LINQ to Entities. It would be something like this:
Dim currentChannels = context.Channels.Where(Function(c) c.Setup.CurrentSetup)
That will then give you a list of all the Channel entities related to the Setup that has its CurrentSetup set to True.
I'm working with Django and I added a new model variable meaning that I need another column in my sqlite3 data base.
I have heard that I'm supposed to use sqlite> , but I am really confused when I start to use it. So, if that is part of the solution, can you be very specific on what to do?
thanks
MORE INFO:
my app is called "livestream" & and my class is "Stream"
I added the model "channel"
returns ---->
DatabaseError: table livestream_stream has no column named channel
You can ALTER TABLE to add a new column in Sqlite3 but not rename it nor drop it. Sqlite3 is a very useful database for bootstrapping your app. But sooner or later, you will need to change to a more robust/flexible database engine, say MySql or Postgresql.
Every time you add a new column to your models using Sqlite, you will need to recreate the schema (as far as I know, when you do migrations with Sqlite to add new columns, south complaints. see below). An approach I like more is use MySql with Django-South from the beginning, where I'm not sure about every aspect of my database.
Django South is an app for doing database migrations. It's very useful and the docs are a good starting point for beginners.
Every time you should make modifications to your database, you should consider them as migrations and use South.
Hope this helps!
I am writing project on ASP.NET MVC 4. The database for this project was not originally designed, and the modification or addition of new tables in the database is done campaign work. I use ADO.NET EF DatabaseFirst. During the work I needed additional properties to store information that I have ordered in the class with the fields of the database.
After that, I need to add a new table, but all of my follow-up in class with fields disappeared after the model update ADO.NET. Who knows how to safely modify my model no change of work already done?? Thanks in advance.