Jump to content


davidoster

Member Since 10 Oct 2012
Offline Last Active Jun 20 2014 12:15 PM
*****

#10259 "datatables" theme loads all my records and then creates pagination?

Posted davidoster on 03 December 2013 - 10:43 PM

Try this, 

$this->db->limit();

Lets you limit the number of rows you would like returned by the query:

$this->db->limit(10);

// Produces: LIMIT 10

The second parameter lets you set a result offset.

$this->db->limit(10, 20);

// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)

or this http://www.grocerycr...functions/limit

e.g. $crud->limit(10);




#10195 Grocery CRUD and Node.js!!!

Posted davidoster on 28 November 2013 - 06:35 AM

And just to conclude, check (if you don't know) this db agnostic MVC framework that out of the box has many similarities with GC!

https://github.com/balderdashy/sails




#10180 Grocery CRUD and Node.js!!!

Posted davidoster on 26 November 2013 - 10:15 AM

Check this out, https://github.com/johnroers/dbCRUD




#9963 Set_relation makes serach not working in bootstrap theme

Posted davidoster on 10 November 2013 - 07:04 AM

Hello and welcome to the forums jacky.

Quick question, have you tried with another theme to see if the search all function works?

I am saying this because the bootstrap theme is not fully developed as it is on an early stage of development and it may contain bugs.




#9653 Concatenate fields after retrieving them from different tables

Posted davidoster on 01 October 2013 - 05:51 PM

Excuse me but you mention just two tables and you never referred to a third one.

If you have another controller that has nothing to do with the two above tables you mentioned, items and item_type then you need to use a custom model to get the data and build something similar to the set_relation function yourself.




#9625 Creating an image gallery using GC

Posted davidoster on 30 September 2013 - 04:04 PM

Some sample code I did that combines the two GC - IC together a while back...

might give you some more insights!

 

http://www.grocerycr...age-2#entry5737

 

 

Good luck Kobus and if you wish/can please share your final code.

 

P.S. I found a bug of the forum by the way.

web-johnny, when you want to get the permalinkof a comment that is not on the first page it comes like this e.g.

http://www.grocerycr...ether#entry5737

where it should be like the above!

Interesting!




#9624 Image crud set relation field

Posted davidoster on 30 September 2013 - 03:48 PM

Hello and welcome to the forums Carlos Avalos.

Image Crud contains an images_examples.php controller (under application/controllers).

If you check the code on example 3 (which is the same with the documentation) it has

set_relation_field('category_id')

and if you check on the database table example_3 it contains 3 records where the category_id has a value of 22.

This means that they are on the same category so they are grouped together. It is as simple as that.




#9547 How to use Invisible field

Posted davidoster on 21 September 2013 - 10:24 PM

As we grow old we get wiser!

So, in that sense I wanted to point out the use of the invisible field.

When we make for example a callback_before_insert (as the above example code states) we might need to exclude some fields from the add form but still want to pass some value to these fields that will be stored on the database.

 

The solution to this is actually quite simple.

We just use the fields function to state all of the fields that will take part on the insert process and this means also the fields that should not be showing up.

Then in order to "hide" the unwanted fields, hence the ones we want not to be displayed at the form and by hand pass them some value we mask them with the use of the field_type function with the use of the invisible type.

This gets quite handy and easy to use when we want for example to insert some extra data about the record that is saved on the database.

For example when we want to save the date/time of insertion, or if we need to know the user that inserted this record, or if we want to encrypt some sort of information like a password. The possibilites are just endless and the mecanism is there to help us out, straight out of the box!




#9427 Repeated rows in list

Posted davidoster on 11 September 2013 - 06:23 AM

Well it shouldn't. First of all I assume that you have checked that the records exist only once within the table right? Silly question but I have to ask anyway!

Secondly, review how the model you load, mod_DBConexion might be affecting the application.

Thirdly, review the ajax_grocery_CRUD extension/library. There might be something suspicious there.

Try to debug using these guidelines to see which part of the application doesn't work well.

Does the GC library gets the data ok but some strange display error get the data displayed twice or more?

Does the GC library returns the same row more than once?

 

Just follow the guidelines in order to see where the problem lies and then try to figure out how to solve it.




#9371 Fatal error: Cannot access empty property in /.../application/librari...

Posted davidoster on 06 September 2013 - 09:03 AM

Hello and welcome to the forums Vole Hare.

Actually Grocery CRUD can't use a view as a table unless you set the primary key!

Check here.

 

Internally GC library uses the PK to do most of its indexing, that's why.




#9340 set field_type (readonly) only edit page

Posted davidoster on 04 September 2013 - 08:54 AM

Yeap. That's another way of doing it! Well done!




#9322 Messed up pagination

Posted davidoster on 04 September 2013 - 03:36 AM

Well on this example http://www.grocerycr.../set_a_relation

the responsible css entry that controls the position is this

.dataTables_paginate {
float: right;
text-align: right;
}
 

http://www.grocerycr....dataTables.css on line 84




#9294 New version 1.4.1

Posted davidoster on 03 September 2013 - 12:29 PM

And I was just about to mention that there is a new maintenance version!

For those you would like to know the new changes on versions 1.4.0 and 1.4.1, here they are:

 

v 1.4.1
    #231 - Read page not showing relations.
    #233 - File upload uniqueid not unique.
v 1.4.0
    #170 - Problem with more than one date inputs at the dialog.
    #148 - New theme twitter-bootstrap
    #150 - Optimizing the SELECT statement for counting rows.
    #144 - Unique fields as new functionallity for unique fields in the database.
    #129 - Small bug uploading images.
    #142 - Extras doesn't work properly when the field doesn't exist in the database
    #158 - New method name set_crud_url_path. This method is useful when the path is not specified correctly.
    #163 - Custom field type label for true_false. Like hidden, enum and set.
    Noty Jquery Plugin to load when you delete a record.
    Upgrading Jquery to Jquery 1.10.2
    Multiple grids in one page.
    New language: Catalan.
    Add "view" as new action.
    Small bug fixes:
        - #165 - add_action "url_has_http" issue
        - #166 - Improved file upload error handling
        - #167 - add_action method in Twitter_Bootstrap theme, doesn't update the dropdown properly

 

 

extract from the change log here.




#9269 Set_relation

Posted davidoster on 31 August 2013 - 09:38 AM

If I understand it correctly tell me if I am wrong,

 

films.codeCategory = category.code

 

and you want when the user selects a category.nameCategory to store the value of category.code to the database, right?




#9265 Double Primary Key not considered

Posted davidoster on 31 August 2013 - 07:36 AM

Hello and welcome to the forums mnish.

Please refer to this post.