volosoft / jtable

A JQuery plugin to create AJAX based CRUD tables.
http://www.jtable.org
1.1k stars 506 forks source link

Newbie here, please help #998

Open acdigital opened 10 years ago

acdigital commented 10 years ago

I am a graphic designer fascinated in learn some php but its not easy.

Well, I have some questions perhaps already answered but I couldn't find it.

The PHP examples are very poor and the java code looks Chinese for me.

I made the installation, bd connection with my own db, tables and data and I customized the PHP samples from jTable to fit my needs, everything works perfect, except in another table one column is kind of mood, sometimes it appears sometimes not.

My problem are:

  1. In the successful page I would like to install 1 level child table such as the one we can see in the jTable.org homepage but all the documentation and examples are very Java and ASP.NET oriented and I cannot figure out how to.

Here is my code that works fine:

<script type="text/javascript">

    $(document).ready(function () {

        //Prepare jTable
        $('#piecesTableContainer1').jtable({
            title: 'Insert Pieces',
            paging: true,
            pageSize: 15,
            sorting: true,
            defaultSorting: 'piece_order_number ASC',
            actions: {
                listAction: 'includes/Pieces_ActionsPagedSorted1.php?action=list',
                createAction: 'includes/Pieces_ActionsPagedSorted1.php?action=create',
                updateAction: 'includes/Pieces_ActionsPagedSorted1.php?action=update',
                deleteAction: 'includes/Pieces_ActionsPagedSorted1.php?action=delete'
            },
            fields: {
                piece_id: {
                    key: true,
                    create: false,
                    edit: false,
                    type: 'hidden',

                },
                piece_order_number: {
                    title: 'Pc #',
                    width: '4%'
                },

                piece_name_fr: {
                    title: 'Name FR',
                    width: ''
                },

                piece_name_en: {
                    title: 'Name EN',
                    width: ''
                },

                piece_mov_fr: {
                    title: 'Mov FR',
                    type: 'textarea',
                    width: ''
                },

                piece_mov_en: {
                    title: 'Mov EN',
                    type: 'textarea',
                    width: ''
                },

                piece_composer: {
                    title: 'Composer',
                    width: ''
                },

                piece_composer_dates: {
                    title: 'Comp_Dates',
                    width: ''
                },

                piece_arranger: {
                    title: 'Arranger',
                    width: ''
                },

                piece_all_players: {
                    title: 'Players',
                    width: ''
                },

                piece_total_time: {
                    title: 'Time',
                    type: 'time',
                    width: '6%'
                }
            }
        });

        //Load person list from server
        $('#piecesTableContainer1').jtable('load');

    });

</script>

Would please someone to help?

Thanks, Paulo

chc88 commented 10 years ago

please look at the asp-examples. The only difference to php for the table itself is the link to the different actions.

acdigital commented 10 years ago

Thank you so much for the prompt answer. Cheers, Paulo