Показать сообщение отдельно
  #6 (permalink)  
Старый 20.08.2014, 15:48
Новичок на форуме
Отправить личное сообщение для AndyTitan Посмотреть профиль Найти все сообщения от AndyTitan
 
Регистрация: 20.08.2014
Сообщений: 9

Грусть пичалька, ничего не работает
тут наверное без api не обойтись...

вот как выглядет таблица, забрасывал скрип и в конец и в начало, толку никакого, не хочет хукать
Не видать мне работы похоже )))
Спасибо и на этом, хоть не почувствовал себя одиноким на этом свете )

<script type="text/javascript">  
		$(document).ready(function () {
      //Prepare jTable
			$('#viewOrders').jtable({
				title: 'Orders',
				paging: true,
				pageSize: 50,
				sorting: true,
				defaultSorting: 'order_id DESC',
				actions: {
					listAction: 'orders-actions.php?action=list',
					createAction: 'orders-actions.php?action=create',
					updateAction: 'orders-actions.php?action=update',
					deleteAction: 'orders-actions.php?action=delete'
				},
				fields: {
					order_id: {
					  title: 'ID',
					  //width: '5%',
            key: true,
            list: false,
						create: false,
						edit: false
					},
                //CHILD TABLE DEFINITION FOR "TRADES"
                Trades: {
                    title: '',
                    width: '3%',
                    sorting: false,
                    edit: false,
                    create: false,
                    display: function (orderTransfers) {
                        //Create an image that will be used to open child table
                        var $img = $('<img src="/assets/img/list_metro.png" title="Edit transfers" />');
                        //Open child table when user clicks the image
                        $img.click(function () {
                            $('#viewOrders').jtable('openChildTable',
                                    $img.closest('tr'),
                                    {
                                        title: 'Transfers',
                                        actions: {
                                            listAction: 'transfers-actions.php?action=list&order_id=' + orderTransfers.record.order_id,
                                  					createAction: 'transfers-actions.php?action=create&order_id=' + orderTransfers.record.order_id,
                                  					updateAction: 'transfers-actions.php?action=update',
                                  					deleteAction: 'transfers-actions.php?action=delete'
                                        },
                                				fields: {
                                          order_id: {
                                            type: 'hidden',
                                            defaultValue: orderTransfers.record.order_id
                                          },
                                					transfer_id: {
                                					  title: 'ID',
                                					  width: '5%',
                                            key: true,
                                						create: false,
                                						edit: false
                                					},
                                					date: {
                                						title: 'Date',
                                						type: 'date',
                                						create: false,
                                						edit: false
                                					},
                                          transfer_time: {
                                						title: 'Time',
                                						create: false,
                                						edit: false
                                					},
                                          server_region: {
                                						title: 'Region',
                                            options: { 'eu': 'Europe', 'us': 'USA'},
                                            edit: false,
                                            list: false
                                					},
                                          option_transfer_id: {
                                            type: 'hidden',
                                            defaultValue: '1'
                                					},
                                          bank_id: {
                                						title: 'Bank',
                                            width: '20%',
                                            dependsOn: 'server_region', //Countries depends on continentals. Thus, jTable builds cascade dropdowns!
                                            options: function (data) {
                                              if (data.source == 'list') {
                                                return 'get-options.php?list=banks';
                                              }
                                              return 'get-options.php?list=banks&region=' + data.dependedValues.server_region;
                                            },
                                            edit: false
                                					},
                                          transfer_ammount: {
                                						title: 'Amount',
                                            edit: false
                                					},
                                          transfer_comment: {
                                						title: 'Comment',
                                            list: false
                                					},
                                          transfer_active: {
                                						title: 'Active',
                                            options: { '1': 'Yes', '0': 'No'},
                                            create: false
                                					},
                                          user_name: {
                                						title: 'Operator',
                                            create: false,
                                            edit: false
                                					}
                                				}

                                    }, function (data) { //opened handler
                                        data.childTable.jtable('load');
                                    });
                        });
                        //Return image to show on the person row
                        return $img;
                    }
                },
					order_date: {
						title: 'Date',
						type: 'date',
						create: false,
						edit: false
					},
          order_time: {
						title: 'Time',
            width: '5%',
						create: false,
						edit: false
					},
          order_product_name: {
						title: 'Name',
            width: '15%',
						create: false
					},
          order_server_region: {
						title: 'Region',
            options: { 'eu': 'Europe', 'us': 'USA'},
            edit: false,
            list: false
					},
          order_server_id: {
						title: 'Server',
            dependsOn: 'order_server_region', //Countries depends on continentals. Thus, jTable builds cascade dropdowns!
            options: function (data) {
              if (data.source == 'list') {
                return 'get-options.php?list=servers';
              }
              return 'get-options.php?list=servers&region=' + data.dependedValues.order_server_region;
            },
            edit: false,
            list: false
					},
          order_platform_id: {
						title: 'Platform',
            defaultValue: '1',
            options: function (data) {
              return 'get-options.php?list=option_platform';
            },
            edit: false
					},
          order_platform_order_id: {
						title: 'Order#',
            edit: false
					},
          order_referrer_id: {
						title: 'Referrer',
            defaultValue: '4',
            options: function (data) {
              return 'get-options.php?list=option_referrer';
            },
            create: false,
            list: false,
            edit: false
					},
          order_wallet_id: {
						title: 'Wallet',
            options: function (data) {
              return 'get-options.php?list=option_wallet';
            },
            list: false
					},
          order_total_price: {
						title: 'Total Price',
            list: false,
            edit: false
					},
          order_ammount: {
						title: 'Amount',
            edit: false
					},
          order_char_name: {
						title: 'Char Name'
					},
          customer_name: {
						title: 'Customer',
            edit: false,
            create: false
					},
          order_comment: {
						title: 'Comment'
					},
          order_status: {
						title: 'Status',
            options: { 'pending': 'Pending', 'complete': 'Complete', 'cancelled': 'Cancelled'}
					},
          operator_name: {
						title: 'Operator',
            list: false,
            create: false,
            edit: false
					}
				}
			});

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

			

		});

	</script>
Ответить с цитированием