Welcome Guest, Not a member yet? Register   Sign In
Jqgrid CRUD 1.1[NEW]
#21

[eluser]Blinkiz[/eluser]
I still can not get formatter to work with Jqgrid CRUD 1.1.

What am I doing wrong here?
Code:
$grid->addField('name');
$grid->label('Namn')->validators (array('showlink' => "{baseLinkUrl:'customer/get'}"));
$grid->params(array('editable' => "'false'"));

When I watch the source, it creates this text:
Code:
,colModel:[
{name:'name',label:'Namn' ,editable:'false' ,formatter:{showlink:{baseLinkUrl:'customer/get'}} }
,{name:'address',label:'address' ,editable:false  }
,{name:'service',label:'Avtal' ,editable:false  }
]
The code above will not give me any errors. It's just ignored by jqgrid and no text will be clickable.
#22

[eluser]Blinkiz[/eluser]
In Jqgrid CRUD 1.1, when I do not specify any fields, the CRUD will self create a nice 'table_fieldname' array. But this is not possible for tables I have joined.

I would like to skip specifying which tables to include from a joined table. So I just modified your join loop a bit.
Code:
if(isset($model['table']) && isset($model['join'])){
    $this->CI->db->join($model['table']/*tablename*/, $model['join']/*join fields*/, (isset($model['type']))?$model['type']:'inner'/*join type*/);
    if(isset($model['fields']) && false == empty($model['fields']) && $prefix){
        foreach($model['fields'] as $field){
            $fields2[] = "{$model['table']}.{$field} AS {$model['table']}_{$field}";
        }
    }else if(isset($model['fields']) && false == empty($model['fields'])){
        echo "echo";
        foreach($model['fields'] as $field){
            $fields2[] = "{$model['table']}.{$field}";

        }
    }
    else if(empty($model['fields']) && $prefix){
        $fieldstable = $this->CI->db->list_fields($model['table']);
        foreach($fieldstable as $field){
            //$fields = array_push((array)$fields, (array)"{$field} AS {$table}_{$field}" );
            $fields2[] = "{$model['table']}.{$field} AS {$model['table']}_{$field}";
        }
    }else if(empty($model['fields'])){
        $fieldstable = $this->CI->db->list_fields($model['table']);
        foreach($fieldstable as $field){
            //$fields = array_push((array)$fields, (array)"{$field} AS {$table}_{$field}" );
            $fields2[] = "{$model['table']}.{$field}";
        }
    }
}
BUT, this will not make it possible to have more than one joined table. Need to change
Code:
$fields = array_merge($fields, $fields2);
into something more dynamic for $fields2
#23

[eluser]epitaph111[/eluser]
Hello vicman this is great, and thank you very much for this. I have a few suggestions for future version

1. Multiple search columns
2. Multiple delete records

Regards
#24

[eluser]columbus13[/eluser]
Hello,

I am trying to setup a master-detail page (as discussed in the jqgrid demos) using CI+jqgrid-crud 1.1. Has anyone done that successfully? Any pointers that can help me begin?

best,
c
#25

[eluser]epitaph111[/eluser]
Hi I have the following problem with CRUD 1.1[NEW]

When you try to add more than 15 fields, jgrid is not shown ... I get a blank page with no errors...


Has anyone had similar experiences?
#26

[eluser]epitaph111[/eluser]
Hmmm this only happens in Firefox...
#27

[eluser]Unknown[/eluser]
Hi vicman,
i'm testing the CRUD v1.1, i found that i must have a field in the table called 'id', i tried with another name but when you send that information, you send the value id with _empty. is any form to change the 'id' for another text, and how i can handle with tables where i have 2 fields in the primary key?

Another thing is that i cant use the export function, i got the error 404, i think i have to install or configure the dompdf.

I will continue testing the aplication, great work.

I have a few suggestions for future version

1. Action column, column with link(and param primary key), when cliked i can show other functionality, like another grid using the primary key as param in the query of the second grid.
2. Multiple search columns
3. Multiple delete records
4. More Skins
#28

[eluser]columbus13[/eluser]
Hello vicman,

I liked your library and have used it in a CI project. I am now working on another very straightforward project that does not involve CI. I would like to use your crud library in this non-CI environment. From the looks of it, I feel that it should be very straightforward. Do you have any suggestions/guidelines I should follow?

best,
c
#29

[eluser]Unknown[/eluser]
Hi,

I'm not sure what I'm doing wrong...

The table and data show up fine, but when I try to add a record/delete or edit a record, I get the Internal Server error 500.

Do you know why that is?

- Nevermind I restarted a project and it seems to work fine now...
Thanks for a great tool!
#30

[eluser]Abu eldahab[/eluser]
Hi

Thanks vicman for the code the demo seems very good

Regards




Theme © iAndrew 2016 - Forum software by © MyBB