Commit fd735c15 authored by Vladislav Bolshakov's avatar Vladislav Bolshakov

barbass:

parent a458c50f
# 404
ErrorDocument 404 /index.php
#
DirectoryIndex index.php
# mod_rewrite
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
\ No newline at end of file
# 404
ErrorDocument 404 /index.php
#
DirectoryIndex index.php
# mod_rewrite
<IfModule mod_rewrite.c>
RewriteBase /
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default but should be enabled
| whenever you intend to do a schema migration.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->latest() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH . 'migrations/';
/* End of file migration.php */
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default but should be enabled
| whenever you intend to do a schema migration.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->latest() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH . 'migrations/';
/* End of file migration.php */
/* Location: ./application/config/migration.php */
\ No newline at end of file
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*TYPOS super admin*/
$config['typos_admin_login'] = 'barbass';
$config['typos_admin_password'] = 'barbass';
$config['typos_admin_email'] = 'barbass@etersoft.ru';
$config['pass']['key_1'] = "ghuHJGOuiар";
$config['pass']['key_2'] = "vD%F&Bv8bcvjnb%65";
$config['pass']['key_3'] = "&^^%$%$*Gposwорапо7д";
$config['error_login_count'] = 3;
$config['error_login_time'] = 600; //10 минут
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*TYPOS super admin*/
$config['typos_admin_login'] = 'barbass';
$config['typos_admin_password'] = 'barbass';
$config['typos_admin_email'] = 'barbass@etersoft.ru';
$config['pass']['key_1'] = "ghuHJGOuiар";
$config['pass']['key_2'] = "vD%F&Bv8bcvjnb%65";
$config['pass']['key_3'] = "&^^%$%$*Gposwорапо7д";
$config['error_login_count'] = 3;
$config['error_login_time'] = 600; //10 минут
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Работа с сайтами - администратор
* - удаление пользователей с ответственности за сайт
* - удаление/добавление/редактирование сайтов
**/
class Sites extends CI_Controller {
function __construct() {
parent::__construct();
$this->user_id = $this->mdl_session->getData('user_id');
$this->usertype = $this->mdl_session->getData('usertype');
if ($this->usertype != 'admin') {
redirect('users/typos');
}
$this->load->model('admins/mdl_sites');
}
/*Создаем шаблон*/
function index() {
$views['body']['url'] = "admins/sites";
$views['menu']['url'] = "menu";
$views['menu']['data']['items'] = $this->mdl_menu->admin();
$this->mdl_views->view($views);
return true;
}
function typos() {
$this->index();
return;
}
/**
* Получить сайты
**/
function getListSites() {
$data = $this->mdl_jqgrid->collectionData();
$data['user_id'] = $this->user_id;
echo json_encode($this->mdl_sites->getListSites($data));
return;
}
/**
* Получить пользователей по сайту
**/
function getListUsers() {
$data = $this->mdl_jqgrid->collectionData();
$data['site_id'] = $this->mdl_request->int("id");
$data['user_id'] = $this->user_id;
echo json_encode($this->mdl_sites->getListUsers($data));
return;
}
/**
* Управление сайтами
**/
function panelSites() {
$oper = $this->mdl_request->string('oper');
if ($oper == 'add') {
$data['site'] = Url::getFormatingUrl($this->mdl_request->string('site'));
$data['status'] = $this->mdl_request->int('status');
$result = $this->mdl_validate->validateSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
$result = $this->mdl_sites->addSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
} elseif ($oper == 'edit') {
$data['site_id'] = $this->mdl_request->int('id');
$data['site'] = Url::getFormatingUrl($this->mdl_request->string('site'));
$data['status'] = $this->mdl_request->int('status');
$result = $this->mdl_validate->validateSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
$result = $this->mdl_sites->editSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
} elseif ($oper == 'del') {
$data['site_id'] = $this->mdl_request->int('id');
$result = $this->mdl_sites->deleteSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
}
return true;
}
/**
* Управление пользователями (ответственность за сайты)
**/
function panelUsers() {
$oper = $this->mdl_request->string('oper');
if ($oper == 'del') {
$this->load->model('admins/mdl_users');
$data['user_id'] = $this->mdl_request->int('id');
$data['site_id'] = $this->mdl_request->int('site_id');
$result = $this->mdl_users->deleteResponsible($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
}
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Работа с сайтами - администратор
* - удаление пользователей с ответственности за сайт
* - удаление/добавление/редактирование сайтов
**/
class Sites extends CI_Controller {
function __construct() {
parent::__construct();
$this->user_id = $this->mdl_session->getData('user_id');
$this->usertype = $this->mdl_session->getData('usertype');
if ($this->usertype != 'admin') {
redirect('users/typos');
}
$this->load->model('admins/mdl_sites');
}
/*Создаем шаблон*/
function index() {
$views['body']['url'] = "admins/sites";
$views['menu']['url'] = "menu";
$views['menu']['data']['items'] = $this->mdl_menu->admin();
$this->mdl_views->view($views);
return true;
}
function typos() {
$this->index();
return;
}
/**
* Получить сайты
**/
function getListSites() {
$data = $this->mdl_jqgrid->collectionData();
$data['user_id'] = $this->user_id;
echo json_encode($this->mdl_sites->getListSites($data));
return;
}
/**
* Получить пользователей по сайту
**/
function getListUsers() {
$data = $this->mdl_jqgrid->collectionData();
$data['site_id'] = $this->mdl_request->int("id");
$data['user_id'] = $this->user_id;
echo json_encode($this->mdl_sites->getListUsers($data));
return;
}
/**
* Управление сайтами
**/
function panelSites() {
$oper = $this->mdl_request->string('oper');
if ($oper == 'add') {
$data['site'] = Url::getFormatingUrl($this->mdl_request->string('site'));
$data['status'] = $this->mdl_request->int('status');
$result = $this->mdl_validate->validateSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
$result = $this->mdl_sites->addSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
} elseif ($oper == 'edit') {
$data['site_id'] = $this->mdl_request->int('id');
$data['site'] = Url::getFormatingUrl($this->mdl_request->string('site'));
$data['status'] = $this->mdl_request->int('status');
$result = $this->mdl_validate->validateSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
$result = $this->mdl_sites->editSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
} elseif ($oper == 'del') {
$data['site_id'] = $this->mdl_request->int('id');
$result = $this->mdl_sites->deleteSite($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
}
return true;
}
/**
* Управление пользователями (ответственность за сайты)
**/
function panelUsers() {
$oper = $this->mdl_request->string('oper');
if ($oper == 'del') {
$this->load->model('admins/mdl_users');
$data['user_id'] = $this->mdl_request->int('id');
$data['site_id'] = $this->mdl_request->int('site_id');
$result = $this->mdl_users->deleteResponsible($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
}
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Авторизация пользователя*/
class Authorized extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('mdl_authorized');;
}
function index() {
$this->load->model('mdl_authorized');
$views['body']['url'] = "authorized";
$views['body']['data']['auth_url'] = $this->config->base_url()."authorized/login";
$this->mdl_views->view($views);
}
function login() {
$views['body']['data']['auth_url'] = $this->config->base_url()."authorized/login";
$views['body']['url'] = "authorized";
if (!$this->_validateCountErrorLogin()) {
$views['body']['data']['error_message'] = "Вы превысили число попыток";
$this->mdl_views->view($views);
return;
}
$login = $this->mdl_request->string('login');
$password = $this->mdl_request->string('password');
if ($login == "" || $password == "") {
$views['body']['data']['error_message'] = "Логин/пароль пустой";
$this->mdl_views->view($views);
return;
}
/*Если совпадает с данными администратора по-умолчанию (см. typos_congig.php)*/
if ($this->config->item('typos_admin_login') && $this->config->item('typos_admin_password') && $this->config->item('typos_admin_email')) {
if ($login == $this->config->item('typos_admin_login') && $password == $this->config->item('typos_admin_password')) {
$this->mdl_session->setData('login', $login);
$this->mdl_session->setData('usertype', 'admin');
$this->mdl_session->setData('email', $this->config->item('typos_admin_email'));
$this->mdl_session->setData('user_id', -1);
$this->session->set_userdata('user_id', -1);
redirect('admins/sites/');
}
}
$user_info = $this->mdl_authorized->getInfo($login);
$password = getHashPass($password, $this->config->item('pass'));
if (!$user_info) {
$this->_errorLogin();
$views['body']['data']['error_message'] = "Пароль/логин не верен";
$this->mdl_views->view($views);
return;
} else {
if ($password == $user_info['password']) {
if ((int)$user_info['activity'] == 1) {
$this->mdl_session->setData('login', $login);
$this->mdl_session->setData('usertype', $user_info['type']);
$this->mdl_session->setData('user_id', $user_info['user_id']);
$this->session->set_userdata('user_id', $user_info['user_id']);
/*Перенаправлям в зависимости от типа пользователя*/
if ($user_info['type'] == 'admin') {
redirect('admins/sites/');
} elseif ($user_info['type'] == 'user') {
redirect('users/typos/');
}
}
} else {
$this->_errorLogin();
$views['body']['data']['error_message'] = "Пароль/логин не верен";
$this->mdl_views->view($views);
return;
}
}
}
function logout() {
$this->session->sess_destroy();
$this->mdl_session->deleteAllData();
redirect("authorized");
}
/*Устанавливаем счетчики ошибок входа*/
function _errorLogin() {
$this->mdl_session->setData('error_login', (int)$this->mdl_session->getData('error_login_count') + 1);
$this->mdl_session->setData('error_login_time', time());
$this->session->set_userdata('error_login', (int)$this->session->userdata('error_login') + 1);
$this->session->set_userdata('error_login_time', time());
}
function _validateCountErrorLogin() {
if (!$this->mdl_session->getData('error_login') && !$this->session->userdata('error_login')) {
return true;
} else {
$count_error = max((int)$this->mdl_session->getData('error_login'), (int)$this->session->userdata('error_login'));
$config_count = ($this->config->item('error_login_count')) ? $this->config->item('error_login_count') : 3;
$config_time = ($this->config->item('error_login_time')) ?$this->config->item('error_login_time') : 10000;
$time_error = max((int)$this->mdl_session->getData('error_login_time'), (int)$this->session->userdata('error_login_time'));
$time_error = time() - $time_error;
/*Если время бана прошло, обнуляем*/
if ($time_error > $config_time) {
$this->mdl_session->setData('error_login_count', 0);
$this->session->userdata('error_login_count', 0);
return true;
}
if ($time_error <= $config_time && $count_error >= $config_count) {
return false;
} else {
return true;
}
}
return true;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Авторизация пользователя*/
class Authorized extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('mdl_authorized');;
}
function index() {
$this->load->model('mdl_authorized');
$views['body']['url'] = "authorized";
$views['body']['data']['auth_url'] = $this->config->base_url()."authorized/login";
$this->mdl_views->view($views);
}
function login() {
$views['body']['data']['auth_url'] = $this->config->base_url()."authorized/login";
$views['body']['url'] = "authorized";
if (!$this->_validateCountErrorLogin()) {
$views['body']['data']['error_message'] = "Вы превысили число попыток";
$this->mdl_views->view($views);
return;
}
$login = $this->mdl_request->string('login');
$password = $this->mdl_request->string('password');
if ($login == "" || $password == "") {
$views['body']['data']['error_message'] = "Логин/пароль пустой";
$this->mdl_views->view($views);
return;
}
/*Если совпадает с данными администратора по-умолчанию (см. typos_congig.php)*/
if ($this->config->item('typos_admin_login') && $this->config->item('typos_admin_password') && $this->config->item('typos_admin_email')) {
if ($login == $this->config->item('typos_admin_login') && $password == $this->config->item('typos_admin_password')) {
$this->mdl_session->setData('login', $login);
$this->mdl_session->setData('usertype', 'admin');
$this->mdl_session->setData('email', $this->config->item('typos_admin_email'));
$this->mdl_session->setData('user_id', -1);
$this->session->set_userdata('user_id', -1);
redirect('admins/sites/');
}
}
$user_info = $this->mdl_authorized->getInfo($login);
$password = getHashPass($password, $this->config->item('pass'));
if (!$user_info) {
$this->_errorLogin();
$views['body']['data']['error_message'] = "Пароль/логин не верен";
$this->mdl_views->view($views);
return;
} else {
if ($password == $user_info['password']) {
if ((int)$user_info['activity'] == 1) {
$this->mdl_session->setData('login', $login);
$this->mdl_session->setData('usertype', $user_info['type']);
$this->mdl_session->setData('user_id', $user_info['user_id']);
$this->session->set_userdata('user_id', $user_info['user_id']);
/*Перенаправлям в зависимости от типа пользователя*/
if ($user_info['type'] == 'admin') {
redirect('admins/sites/');
} elseif ($user_info['type'] == 'user') {
redirect('users/typos/');
}
}
} else {
$this->_errorLogin();
$views['body']['data']['error_message'] = "Пароль/логин не верен";
$this->mdl_views->view($views);
return;
}
}
}
function logout() {
$this->session->sess_destroy();
$this->mdl_session->deleteAllData();
redirect("authorized");
}
/*Устанавливаем счетчики ошибок входа*/
function _errorLogin() {
$this->mdl_session->setData('error_login', (int)$this->mdl_session->getData('error_login_count') + 1);
$this->mdl_session->setData('error_login_time', time());
$this->session->set_userdata('error_login', (int)$this->session->userdata('error_login') + 1);
$this->session->set_userdata('error_login_time', time());
}
function _validateCountErrorLogin() {
if (!$this->mdl_session->getData('error_login') && !$this->session->userdata('error_login')) {
return true;
} else {
$count_error = max((int)$this->mdl_session->getData('error_login'), (int)$this->session->userdata('error_login'));
$config_count = ($this->config->item('error_login_count')) ? $this->config->item('error_login_count') : 3;
$config_time = ($this->config->item('error_login_time')) ?$this->config->item('error_login_time') : 10000;
$time_error = max((int)$this->mdl_session->getData('error_login_time'), (int)$this->session->userdata('error_login_time'));
$time_error = time() - $time_error;
/*Если время бана прошло, обнуляем*/
if ($time_error > $config_time) {
$this->mdl_session->setData('error_login_count', 0);
$this->session->userdata('error_login_count', 0);
return true;
}
if ($time_error <= $config_time && $count_error >= $config_count) {
return false;
} else {
return true;
}
}
return true;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с опечатками - пользователь*/
class Typos extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('users/mdl_typos');
$this->user_id = $this->mdl_session->getData('user_id');
}
/*Создаем шаблон*/
function index() {
if ($this->mdl_session->getData('usertype') == 'admin') {
$views['menu']['data']['items'] = $this->mdl_menu->admin();
}
if ($this->mdl_session->getData('usertype') == 'user') {
$views['menu']['data']['items'] = $this->mdl_menu->user();
}
$views['body']['url'] = "users/typos";
$views['menu']['url'] = "menu";
$this->mdl_views->view($views);
return;
}
function typos() {
$this->index();
return;
}
/*Получить список сайтов для пользователя*/
function getListSites() {
$data = $this->mdl_jqgrid->collectionData();
$data['user_id'] = $this->user_id;
echo json_encode($this->mdl_typos->getUserSites($data));
return;
}
/*Получить список сообщений об опечатках для пользователя*/
function getListMessages() {
$data = $this->mdl_jqgrid->collectionData();
$data['site_id'] = $this->mdl_request->int("id");
$data['user_id'] = $this->user_id;
echo json_encode($this->mdl_typos->getListMessages($data));
return;
}
/*Управление сайтами*/
function panelSites() {
$oper = $this->mdl_request->string("oper");
$data['site_id'] = $this->mdl_request->int("id");
$data['status'] = $this->mdl_request->int("rstatus");
$data['user_id'] = $this->user_id;
if ($oper == 'edit') {
if ($data['status'] != 0 && $data['status'] != 1) {
return array('success' => 'false', 'message' => 'Не верный статус сообщения');
}
$this->mdl_typos->updateStatus($data);
return;
}
}
/*Управление сообщениями*/
function panelMessages() {
$oper = $this->mdl_request->string('oper');
$data = array();
if ($oper == 'add') {
$data['site_id'] = $this->mdl_request->int('site_id');
$data['link'] = Url::getFormatingUrl($this->mdl_request->string('link'));
$data['text'] = $this->mdl_request->string('text');
$data['comment'] = $this->mdl_request->string('comment');
$data['status'] = $this->mdl_request->int('status');
$data['user_id'] = $this->user_id;
$result = $this->mdl_validate->validateMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
if (!$this->mdl_validate->validateUserLinkOnSite($data)) {
echo json_encode(array('success' => 'false', 'message' => 'Ссылка не принадлежит данному сайту'));
return;
}
$result = $this->mdl_typos->addMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
return;
} elseif ($oper == 'del') {
$data['message_id'] = $this->mdl_request->int('id');
$data['site_id'] = $this->mdl_request->int('site_id');
$data['user_id'] = $this->user_id;
$result = $this->mdl_typos->deleteMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
return;
} elseif ($oper == 'edit') {
$data['message_id'] = $this->mdl_request->int('id');
$data['site_id'] = $this->mdl_request->int('site_id');
$data['status'] = $this->mdl_request->int('status');
$data['link'] = Url::getFormatingUrl($this->mdl_request->string('link'));
$data['text'] = $this->mdl_request->string('text');
$data['comment'] = $this->mdl_request->string('comment');
$data['user_id'] = $this->user_id;
$result = $this->mdl_validate->validateMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
if (!$this->mdl_validate->validateUserLinkOnSite($data)) {
echo json_encode(array('success' => 'false', 'message' => 'Ссылка не принадлежит данному сайту'));
return;
}
$result = $this->mdl_typos->editMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
return;
}
return;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с опечатками - пользователь*/
class Typos extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('users/mdl_typos');
$this->user_id = $this->mdl_session->getData('user_id');
}
/*Создаем шаблон*/
function index() {
if ($this->mdl_session->getData('usertype') == 'admin') {
$views['menu']['data']['items'] = $this->mdl_menu->admin();
}
if ($this->mdl_session->getData('usertype') == 'user') {
$views['menu']['data']['items'] = $this->mdl_menu->user();
}
$views['body']['url'] = "users/typos";
$views['menu']['url'] = "menu";
$this->mdl_views->view($views);
return;
}
function typos() {
$this->index();
return;
}
/*Получить список сайтов для пользователя*/
function getListSites() {
$data = $this->mdl_jqgrid->collectionData();
$data['user_id'] = $this->user_id;
echo json_encode($this->mdl_typos->getUserSites($data));
return;
}
/*Получить список сообщений об опечатках для пользователя*/
function getListMessages() {
$data = $this->mdl_jqgrid->collectionData();
$data['site_id'] = $this->mdl_request->int("id");
$data['user_id'] = $this->user_id;
echo json_encode($this->mdl_typos->getListMessages($data));
return;
}
/*Управление сайтами*/
function panelSites() {
$oper = $this->mdl_request->string("oper");
$data['site_id'] = $this->mdl_request->int("id");
$data['status'] = $this->mdl_request->int("rstatus");
$data['user_id'] = $this->user_id;
if ($oper == 'edit') {
if ($data['status'] != 0 && $data['status'] != 1) {
return array('success' => 'false', 'message' => 'Не верный статус сообщения');
}
$this->mdl_typos->updateStatus($data);
return;
}
}
/*Управление сообщениями*/
function panelMessages() {
$oper = $this->mdl_request->string('oper');
$data = array();
if ($oper == 'add') {
$data['site_id'] = $this->mdl_request->int('site_id');
$data['link'] = Url::getFormatingUrl($this->mdl_request->string('link'));
$data['text'] = $this->mdl_request->string('text');
$data['comment'] = $this->mdl_request->string('comment');
$data['status'] = $this->mdl_request->int('status');
$data['user_id'] = $this->user_id;
$result = $this->mdl_validate->validateMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
if (!$this->mdl_validate->validateUserLinkOnSite($data)) {
echo json_encode(array('success' => 'false', 'message' => 'Ссылка не принадлежит данному сайту'));
return;
}
$result = $this->mdl_typos->addMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
return;
} elseif ($oper == 'del') {
$data['message_id'] = $this->mdl_request->int('id');
$data['site_id'] = $this->mdl_request->int('site_id');
$data['user_id'] = $this->user_id;
$result = $this->mdl_typos->deleteMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
return;
} elseif ($oper == 'edit') {
$data['message_id'] = $this->mdl_request->int('id');
$data['site_id'] = $this->mdl_request->int('site_id');
$data['status'] = $this->mdl_request->int('status');
$data['link'] = Url::getFormatingUrl($this->mdl_request->string('link'));
$data['text'] = $this->mdl_request->string('text');
$data['comment'] = $this->mdl_request->string('comment');
$data['user_id'] = $this->user_id;
$result = $this->mdl_validate->validateMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
if (!$this->mdl_validate->validateUserLinkOnSite($data)) {
echo json_encode(array('success' => 'false', 'message' => 'Ссылка не принадлежит данному сайту'));
return;
}
$result = $this->mdl_typos->editMessage($data);
if (is_array($result)) {
echo json_encode($result);
return;
}
return;
}
return;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Включение сессий*/
class Session {
function __construct() {
if (!session_id()) {
ini_set('session.use_cookies', 'On');
ini_set('session.use_trans_sid', 'Off');
session_set_cookie_params(0, '/');
session_start();
}
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Включение сессий*/
class Session {
function __construct() {
if (!session_id()) {
ini_set('session.use_cookies', 'On');
ini_set('session.use_trans_sid', 'Off');
session_set_cookie_params(0, '/');
session_start();
}
}
}
/**/
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Проверка авторизированности пользователя*/
class Validate_authorized extends CI_Controller {
/*Если не страница авторизации/проверки логина/пароля - перенаправляем на главную*/
function index() {
$class = $this->uri->segment(1);
$method = $this->uri->segment(2);
if ((!$class) ||
($class == 'authorized') ||
($class.'/'.$method == 'authorized/check') ||
($class.'/'.$method == 'authorized/logout') ||
($class.'/'.$method == 'server/processData')
) {
return true;
} else {
if (!$this->session->userdata('user_id')) {
redirect('authorized');
return;
}
}
return;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Проверка авторизированности пользователя*/
class Validate_authorized extends CI_Controller {
/*Если не страница авторизации/проверки логина/пароля - перенаправляем на главную*/
function index() {
$class = $this->uri->segment(1);
$method = $this->uri->segment(2);
if ((!$class) ||
($class == 'authorized') ||
($class.'/'.$method == 'authorized/check') ||
($class.'/'.$method == 'authorized/logout') ||
($class.'/'.$method == 'server/processData')
) {
return true;
} else {
if (!$this->session->userdata('user_id')) {
redirect('authorized');
return;
}
}
return;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с пользователями*/
class Mdl_users extends CI_Model {
/*
* Получаем всех пользователей
**/
function getListUsers($data) {
/*Данные для pagination jqGrid*/
if ($data['querysearchstring'] != "") {
$data['querysearchstring'] = " WHERE ".$data['querysearchstring']." ";
}
$data['query_count'] = "SELECT COUNT(user_id) AS count FROM user ".$data['querysearchstring']." ";
$data_pagination = $this->mdl_jqgrid->Pagination($data);
/**/
$return_data = array(
'page' => $data_pagination['page'],
'total' => $data_pagination['total'],
'records' => $data_pagination['records'],
'rows' => array(),
);
$query_users = "SELECT user_id,
login,
type,
email,
firstname,
middlename,
lastname,
activity,
datetime_add
FROM user AS u
".$data['querysearchstring']."
ORDER BY ".$data['sidx']." ".$data['sord']."
LIMIT ".$data_pagination['start']." , ".$data_pagination['limit']." ";
$query = $this->db->query($query_users);
if ($query->num_rows() > 0) {
foreach($query->result_array() as $row) {
$return_data['rows'][] = array(
'id' => $row['user_id'],
'cell' => array(
$row['user_id'],
$row['login'],
$row['type'],
$row['email'],
'******',
$row['firstname'],
$row['middlename'],
$row['lastname'],
$row['activity'],
$row['datetime_add']
)
);
}
}
return $return_data;
}
/*
* Добавляем пользователя
**/
function addUser($data) {
$data['password'] = getHashPass($data['password'], $this->config->item('pass'));
return $this->mdl_stored_query->insertUser($data);
}
/* Редактирование данных о клиенте
* если пароль не новый (т.е. равен ******), то в запросе не обновляем его
**/
function editUser($data) {
if ($data['password'] != '******') {
$data['password'] = getHashPass($data['password'], $this->config->item('pass'));
}
return $this->mdl_stored_query->updateUser($data);
}
/*
* Удаляем пользователя
**/
function deleteUser($data) {
return $this->mdl_stored_query->deleteUser($data);
}
/*Добавляем ответственного за сайт*/
function addResponsible($data) {
if (!$this->mdl_validate->validateUserOnId($data)) {
return array('success'=> 'false', 'message' => "Пользователь не существует");
}
if (!$this->mdl_validate->validateResponsibleToSite($data)) {
return array('success'=> 'false', 'message' => "Этот сайт уже назначен");
}
if (!$this->mdl_validate->validateSiteOnId($data)) {
return array('success'=> 'false', 'message' => "Сайт не существует");
}
return $this->mdl_stored_query->insertResponsible($data);
}
/*
* Обновляем статус ответственного за сайт (email-рассылка)
**/
function editResponsible($data) {
return $this->mdl_stored_query->updateResponsibleStatus($data);
}
/*
* Снимаем ответсвенного
**/
function deleteResponsible($data) {
return $this->mdl_stored_query->deleteResponsible($data);
}
/*
* Получаем сайты для пользователя, кроме уже принадлежащих
**/
function getSites($user_id) {
$query = $this->db->query("SELECT site_id, site
FROM site
WHERE site_id NOT IN (SELECT site_id
FROM responsible
WHERE user_id = '".(int)$user_id."'
)
");
return ($query->num_rows() > 0) ? $query->result_array() : false;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с пользователями*/
class Mdl_users extends CI_Model {
/*
* Получаем всех пользователей
**/
function getListUsers($data) {
/*Данные для pagination jqGrid*/
if ($data['querysearchstring'] != "") {
$data['querysearchstring'] = " WHERE ".$data['querysearchstring']." ";
}
$data['query_count'] = "SELECT COUNT(user_id) AS count FROM user ".$data['querysearchstring']." ";
$data_pagination = $this->mdl_jqgrid->Pagination($data);
/**/
$return_data = array(
'page' => $data_pagination['page'],
'total' => $data_pagination['total'],
'records' => $data_pagination['records'],
'rows' => array(),
);
$query_users = "SELECT user_id,
login,
type,
email,
firstname,
middlename,
lastname,
activity,
datetime_add
FROM user AS u
".$data['querysearchstring']."
ORDER BY ".$data['sidx']." ".$data['sord']."
LIMIT ".$data_pagination['start']." , ".$data_pagination['limit']." ";
$query = $this->db->query($query_users);
if ($query->num_rows() > 0) {
foreach($query->result_array() as $row) {
$return_data['rows'][] = array(
'id' => $row['user_id'],
'cell' => array(
$row['user_id'],
$row['login'],
$row['type'],
$row['email'],
'******',
$row['firstname'],
$row['middlename'],
$row['lastname'],
$row['activity'],
$row['datetime_add']
)
);
}
}
return $return_data;
}
/*
* Добавляем пользователя
**/
function addUser($data) {
$data['password'] = getHashPass($data['password'], $this->config->item('pass'));
return $this->mdl_stored_query->insertUser($data);
}
/* Редактирование данных о клиенте
* если пароль не новый (т.е. равен ******), то в запросе не обновляем его
**/
function editUser($data) {
if ($data['password'] != '******') {
$data['password'] = getHashPass($data['password'], $this->config->item('pass'));
}
return $this->mdl_stored_query->updateUser($data);
}
/*
* Удаляем пользователя
**/
function deleteUser($data) {
return $this->mdl_stored_query->deleteUser($data);
}
/*Добавляем ответственного за сайт*/
function addResponsible($data) {
if (!$this->mdl_validate->validateUserOnId($data)) {
return array('success'=> 'false', 'message' => "Пользователь не существует");
}
if (!$this->mdl_validate->validateResponsibleToSite($data)) {
return array('success'=> 'false', 'message' => "Этот сайт уже назначен");
}
if (!$this->mdl_validate->validateSiteOnId($data)) {
return array('success'=> 'false', 'message' => "Сайт не существует");
}
return $this->mdl_stored_query->insertResponsible($data);
}
/*
* Обновляем статус ответственного за сайт (email-рассылка)
**/
function editResponsible($data) {
return $this->mdl_stored_query->updateResponsibleStatus($data);
}
/*
* Снимаем ответсвенного
**/
function deleteResponsible($data) {
return $this->mdl_stored_query->deleteResponsible($data);
}
/*
* Получаем сайты для пользователя, кроме уже принадлежащих
**/
function getSites($user_id) {
$query = $this->db->query("SELECT site_id, site
FROM site
WHERE site_id NOT IN (SELECT site_id
FROM responsible
WHERE user_id = '".(int)$user_id."'
)
");
return ($query->num_rows() > 0) ? $query->result_array() : false;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с пользовательскими данными*/
class Mdl_authorized extends CI_Model {
/*Информация о пользователе*/
function getInfo($login) {
$query = "SELECT * FROM user WHERE login = ".$this->db->escape($login)." LIMIT 1";
$query = $this->db->query($query);
if (!$query) {return false;}
if ($query->num_rows > 0) {
return $query->row_array();
}
return false;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с пользовательскими данными*/
class Mdl_authorized extends CI_Model {
/*Информация о пользователе*/
function getInfo($login) {
$query = "SELECT * FROM user WHERE login = ".$this->db->escape($login)." LIMIT 1";
$query = $this->db->query($query);
if (!$query) {return false;}
if ($query->num_rows > 0) {
return $query->row_array();
}
return false;
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Построение поискового запроса*/
class Mdl_jqgrid extends CI_Model {
//Построение части запроса (поле->значение)
function createSearch($data) {
$search = $data['search'];
$searchstring = "";
if ($search != "true") {
return $searchstring;
}
$searchField = $data['searchField'];
$searchOper = $data['searchOper'];
$searchString = $data['searchString'];
$s = " ".$searchField." ";
switch ($searchOper) {
case 'eq':
$s .= " = ".$this->db->escape($searchString);
break;
case 'ne':
$s .= " != ".$this->db->escape($searchString);
break;
case 'lt':
$s .= " < ".$this->db->escape($searchString);
break;
case 'le':
$s .= " <= ".$this->db->escape($searchString);
break;
case 'gt':
$s .= " > ".$this->db->escape($searchString);
break;
case 'ge':
$s .= " >= ".$this->db->escape($searchString);
break;
case 'bw':
$s .= "LIKE ".$this->db->escape($searchString."%");
break;
case 'bn':
$s .= "NOT LIKE ".$this->db->escape($searchString."%");
break;
case 'ew':
$s .= "LIKE ".$this->db->escape("%".$searchString);
break;
case 'en':
$s .= "NOT LIKE ".$this->db->escape("%".$searchString);
break;
case 'cn':
$s .= "LIKE ".$this->db->escape("%".$searchString."%");
break;
case 'nc':
$s .= "NOT LIKE ".$this->db->escape("%".$searchString."%");
break;
case 'nu':
$s .= "IS NULL";
break;
case 'nn':
$s .= "IS NOT NULL";
break;
case 'in':
$str_array = explode(',', $searchString);
$str_array = array_map(function($value) {return $this->db->escape($value);}, $str_array);
$string = implode(',', $str_array);
$s .= "IN (".$searchString.")";
break;
case 'ni':
$str_array = explode(',', $searchString);
$str_array = array_map(function($value) {return $this->db->escape($value);}, $str_array);
$string = implode(',', $str_array);
$s .= "NOT IN (".$searchString.")";
break;
default:
$s = "";
break;
}
return $s." ";
}
//Собираем параметры, общие для плагина
function collectionData() {
$data['page'] = $this->mdl_request->int('page', 1);
$data['limit'] = $this->mdl_request->int('rows', 10);
if ($data['limit'] <= 0) {$data['limit'] = 10;}
$data['sord'] = $this->mdl_request->string('sord');
$data['sidx'] = $this->mdl_request->string('sidx');
$data['search'] = $this->mdl_request->string('_search', 'false');
$data['searchField'] = $this->mdl_request->string('searchField');
$data['searchOper'] = $this->mdl_request->string('searchOper');
$data['searchString'] = $this->mdl_request->string('searchString');
$data['querysearchstring'] = $this->createSearch($data);
return $data;
}
function Pagination($data) {
$page = (int)$data['page'];
$limit = (int)$data['limit'];
$sord = $data['sord'];
$sidx = $data['sidx'];
$query = $this->db->query($data['query_count']);
if ($query->num_rows() > 0) {
$count = $query->row_array()['count'];
} else {
$count = 0;
}
if ($count > 0) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) {
$page = $total_pages;
}
$start = $limit*$page - $limit;
if ($start < 0) {
$start = 0;
}
return array(
'page' => $page,
'total' => $total_pages,
'records' => $count,
'start' => $start,
'limit' => $limit
);
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Построение поискового запроса*/
class Mdl_jqgrid extends CI_Model {
//Построение части запроса (поле->значение)
function createSearch($data) {
$search = $data['search'];
$searchstring = "";
if ($search != "true") {
return $searchstring;
}
$searchField = $data['searchField'];
$searchOper = $data['searchOper'];
$searchString = $data['searchString'];
$s = " ".$searchField." ";
switch ($searchOper) {
case 'eq':
$s .= " = ".$this->db->escape($searchString);
break;
case 'ne':
$s .= " != ".$this->db->escape($searchString);
break;
case 'lt':
$s .= " < ".$this->db->escape($searchString);
break;
case 'le':
$s .= " <= ".$this->db->escape($searchString);
break;
case 'gt':
$s .= " > ".$this->db->escape($searchString);
break;
case 'ge':
$s .= " >= ".$this->db->escape($searchString);
break;
case 'bw':
$s .= "LIKE ".$this->db->escape($searchString."%");
break;
case 'bn':
$s .= "NOT LIKE ".$this->db->escape($searchString."%");
break;
case 'ew':
$s .= "LIKE ".$this->db->escape("%".$searchString);
break;
case 'en':
$s .= "NOT LIKE ".$this->db->escape("%".$searchString);
break;
case 'cn':
$s .= "LIKE ".$this->db->escape("%".$searchString."%");
break;
case 'nc':
$s .= "NOT LIKE ".$this->db->escape("%".$searchString."%");
break;
case 'nu':
$s .= "IS NULL";
break;
case 'nn':
$s .= "IS NOT NULL";
break;
case 'in':
$str_array = explode(',', $searchString);
$str_array = array_map(function($value) {return $this->db->escape($value);}, $str_array);
$string = implode(',', $str_array);
$s .= "IN (".$searchString.")";
break;
case 'ni':
$str_array = explode(',', $searchString);
$str_array = array_map(function($value) {return $this->db->escape($value);}, $str_array);
$string = implode(',', $str_array);
$s .= "NOT IN (".$searchString.")";
break;
default:
$s = "";
break;
}
return $s." ";
}
//Собираем параметры, общие для плагина
function collectionData() {
$data['page'] = $this->mdl_request->int('page', 1);
$data['limit'] = $this->mdl_request->int('rows', 10);
if ($data['limit'] <= 0) {$data['limit'] = 10;}
$data['sord'] = $this->mdl_request->string('sord');
$data['sidx'] = $this->mdl_request->string('sidx');
$data['search'] = $this->mdl_request->string('_search', 'false');
$data['searchField'] = $this->mdl_request->string('searchField');
$data['searchOper'] = $this->mdl_request->string('searchOper');
$data['searchString'] = $this->mdl_request->string('searchString');
$data['querysearchstring'] = $this->createSearch($data);
return $data;
}
function Pagination($data) {
$page = (int)$data['page'];
$limit = (int)$data['limit'];
$sord = $data['sord'];
$sidx = $data['sidx'];
$query = $this->db->query($data['query_count']);
if ($query->num_rows() > 0) {
$count_arr = $query->row_array();
$count = $count_arr['count'];
} else {
$count = 0;
}
if ($count > 0) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) {
$page = $total_pages;
}
$start = $limit*$page - $limit;
if ($start < 0) {
$start = 0;
}
return array(
'page' => $page,
'total' => $total_pages,
'records' => $count,
'start' => $start,
'limit' => $limit
);
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Создание меню*/
class Mdl_menu extends CI_Model {
function admin() {
$data['sites'] = "<a href='".$this->config->base_url()."index.php/admins/sites'>Сайты</a>";
$data['users'] = "<a href='".$this->config->base_url()."index.php/admins/users'>Пользователи</a>";
$data['typos'] = "<a href='".$this->config->base_url()."index.php/users/typos'>Опечатки</a>";
$data['logout'] = "<a href='".$this->config->base_url()."index.php/authorized/logout'>Выйти</a>";
return $data;
}
function user() {
$data['logout'] = "<a href='".$this->config->base_url()."index.php/authorized/logout'>Выйти</a>";
return $data;
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Создание меню*/
class Mdl_menu extends CI_Model {
function admin() {
$data['sites'] = "<a href='".$this->config->base_url()."index.php/admins/sites'>Сайты</a>";
$data['users'] = "<a href='".$this->config->base_url()."index.php/admins/users'>Пользователи</a>";
$data['typos'] = "<a href='".$this->config->base_url()."index.php/users/typos'>Опечатки</a>";
$data['logout'] = "<a href='".$this->config->base_url()."index.php/authorized/logout'>Выйти</a>";
return $data;
}
function user() {
$data['logout'] = "<a href='".$this->config->base_url()."index.php/authorized/logout'>Выйти</a>";
return $data;
}
}
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Обработка входящих данных*/
class Mdl_request extends CI_Model {
function data($key = '', $default = '') {
if (!$this->input->get_post($key)) {
return $default;
} else {
return $this->input->get_post($key, TRUE);
}
return false;
}
function int($key = '', $default = 0) {
if (!$this->input->get_post($key)) {
return $default;
} else {
return (int)$this->input->get_post($key);
}
return false;
}
function float($key = '', $default = 0) {
if (!$this->input->get_post($key)) {
return $default;
} else {
return (float)$this->input->get_post($key);
}
return false;
}
function string($key, $default = '') {
if (!$this->input->get_post($key)) {
return $default;
} else {
return trim(strval($this->input->get_post($key, TRUE)));
}
return false;
}
function request() {
return $this->input->get_post(NULL, TRUE);
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Обработка входящих данных*/
class Mdl_request extends CI_Model {
function data($key = '', $default = '') {
if (!$this->input->get_post($key)) {
return $default;
} else {
return $this->input->get_post($key, TRUE);
}
return false;
}
function int($key = '', $default = 0) {
if (!$this->input->get_post($key)) {
return $default;
} else {
return (int)$this->input->get_post($key);
}
return false;
}
function float($key = '', $default = 0) {
if (!$this->input->get_post($key)) {
return $default;
} else {
return (float)$this->input->get_post($key);
}
return false;
}
function string($key, $default = '') {
if (!$this->input->get_post($key)) {
return $default;
} else {
return trim(strval($this->input->get_post($key, TRUE)));
}
return false;
}
function request() {
return $this->input->get_post(NULL, TRUE);
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с сессиями*/
class Mdl_session extends CI_Model {
function __construct() {
if (!session_id()) {
return false;
}
}
/*Установить данные*/
function setData($key, $value) {
$_SESSION[strval($key)] = serialize($value);
}
/*Получить данные*/
function getData($key) {
if ($this->validateData($key)) {
return unserialize($_SESSION[strval($key)]);
} else {
return false;
}
}
/*Проверить существование данных*/
function validateData($key) {
if (!isset($_SESSION[strval($key)])) {
return false;
} else {
return true;
}
}
/*Удаляем данные*/
function deleteData($key) {
unset($_SESSION[strval($key)]);
}
/*Удаляем все данные сессии*/
function deleteAllData() {
unset($_SESSION);
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с сессиями*/
class Mdl_session extends CI_Model {
function __construct() {
if (!session_id()) {
return false;
}
}
/*Установить данные*/
function setData($key, $value) {
$_SESSION[strval($key)] = serialize($value);
}
/*Получить данные*/
function getData($key) {
if ($this->validateData($key)) {
return unserialize($_SESSION[strval($key)]);
} else {
return false;
}
}
/*Проверить существование данных*/
function validateData($key) {
if (!isset($_SESSION[strval($key)])) {
return false;
} else {
return true;
}
}
/*Удаляем данные*/
function deleteData($key) {
unset($_SESSION[strval($key)]);
}
/*Удаляем все данные сессии*/
function deleteAllData() {
unset($_SESSION);
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с шаблонами*/
class Mdl_views extends CI_Model {
/*Загружаем основные шаблоны*/
function view($data = array()) {
$url = $this->config->item('base_url');
$data['header']['base_url'] = $url;
$data['menu']['base_url'] = $url;
$data['body']['base_url'] = $url;
$data['footer']['base_url'] = $url;
/**/
$this->load->view('header', $data['header']);
if (isset($data['menu']['url']) && isset($data['menu']['data'])) {
$this->load->view($data['menu']['url'], $data['menu']['data']);
}
if (!isset($data['body']['data'])) {
$data['body']['data'] = array();
}
$this->load->view($data['body']['url'], $data['body']['data']);
$this->load->view('footer', $data['footer']);
/**/
}
}
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с шаблонами*/
class Mdl_views extends CI_Model {
/*Загружаем основные шаблоны*/
function view($data = array()) {
$url = $this->config->item('base_url');
$data['header']['base_url'] = $url;
$data['menu']['base_url'] = $url;
$data['body']['base_url'] = $url;
$data['footer']['base_url'] = $url;
/**/
$this->load->view('header', $data['header']);
if (isset($data['menu']['url']) && isset($data['menu']['data'])) {
$this->load->view($data['menu']['url'], $data['menu']['data']);
}
if (!isset($data['body']['data'])) {
$data['body']['data'] = array();
}
$this->load->view($data['body']['url'], $data['body']['data']);
$this->load->view('footer', $data['footer']);
/**/
}
}
/**/
\ No newline at end of file
<?php if (isset($error_message)) { ?>
<div class="warning"><?php echo $error_message;?></div>
<?php } ?>
<form action="<?php echo $auth_url;?>" method="POST">
<table>
<tr>
<td>Логин:</td>
<td><input name="login" type="text" required/></td>
</tr>
<tr>
<td>Пароль:</td>
<td><input name="password" type="password" required/></td>
</tr>
<tr>
<td><input type="submit" value="Войти"/></td>
</tr>
</table>
</form>
<?php if (isset($error_message)) { ?>
<div class="warning"><?php echo $error_message;?></div>
<?php } ?>
<form action="<?php echo $auth_url;?>" method="POST">
<table>
<tr>
<td>Логин:</td>
<td><input name="login" type="text" required/></td>
</tr>
<tr>
<td>Пароль:</td>
<td><input name="password" type="password" required/></td>
</tr>
<tr>
<td><input type="submit" value="Войти"/></td>
</tr>
</table>
</form>
</div>
</div>
<footer id="footer">
<p>Copyright (c) barbass 2012</p>
</footer>
</body>
</div>
</div>
<footer id="footer">
<p>Copyright (c) barbass 2012</p>
</footer>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<title>TYPOS@ETERSOFT - Сервис опечаток</title>
<!--Скрипты и стили-->
<!--<script src="<?=$base_url;?>javascript/typos.config.js" type="text/javascript"></script>-->
<script src="<?=$base_url;?>javascript/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="<?=$base_url;?>javascript/jquery_plugins/jquery-ui/jquery-ui-1.10.3/ui/minified/jquery-ui.min.js" type="text/javascript"></script>
<link type="text/css" href="<?=$base_url;?>javascript/jquery_plugins/jquery-ui/jquery-ui-1.10.3/themes/ui-lightness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
<link type="text/css" href="<?=$base_url;?>stylesheet/stylesheet.css" rel="stylesheet" />
</head>
<body>
<!-- Шапка -->
<div id="head">
<h3> TYPOS </h3>
</div>
<div id="page">
<div id="content">
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<title>TYPOS@ETERSOFT - Сервис опечаток</title>
<!--Скрипты и стили-->
<!--<script src="<?=$base_url;?>javascript/typos.config.js" type="text/javascript"></script>-->
<script src="<?=$base_url;?>javascript/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="<?=$base_url;?>javascript/jquery_plugins/jquery-ui/jquery-ui-1.10.3/ui/minified/jquery-ui.min.js" type="text/javascript"></script>
<link type="text/css" href="<?=$base_url;?>javascript/jquery_plugins/jquery-ui/jquery-ui-1.10.3/themes/ui-lightness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
<link type="text/css" href="<?=$base_url;?>stylesheet/stylesheet.css" rel="stylesheet" />
</head>
<body>
<!-- Шапка -->
<div id="head">
<h3> TYPOS </h3>
</div>
<div id="page">
<div id="content">
<div class="left">
<div id="menu">
<span class="heading">Меню</span>
<div class="items">
<ul>
<?php
if ($items) {
foreach ($items as $item) {
echo "<li>".$item."</li>";
}
}
?>
</ul>
</div>
</div>
<div class="left">
<div id="menu">
<span class="heading">Меню</span>
<div class="items">
<ul>
<?php
if ($items) {
foreach ($items as $item) {
echo "<li>".$item."</li>";
}
}
?>
</ul>
</div>
</div>
</div>
\ No newline at end of file
......@@ -78,6 +78,9 @@ ETYPOS.prototype = {
openWindow: function() {
var main_div = document.querySelector(".e_typos_div");
this.userdata['text'] = this.getSelectText();
main_div.querySelector(".e_typos_desc .e_typos_desc_text").innerHTML = this.userdata['text'];
//Определяем на какой позиции X, Y всплывет элемент
var top = window.pageYOffset + window.innerHeight/3;
var left = window.pageXOffset + window.innerWidth/3;
......@@ -133,7 +136,7 @@ ETYPOS.prototype = {
/*Сбор данных*/
postData: function() {
this.userdata['url'] = window.location.href;
this.userdata['text'] = this.getSelectText();
//this.userdata['text'] = this.getSelectText();
this.userdata['comment'] = (document.querySelector(".e_typos_div .e_typos_comment")) ? document.querySelector(".e_typos_div .e_typos_comment").value : '';
try {
......
......@@ -2,12 +2,18 @@
<head>
<meta charset="utf-8" />
<title>Сервис опечаток</title>
<!-- Этот код прописываем в head -->
<script src="etersoft_typos.js"></script>
<link type="text/css" href="etersoft_typos.css" rel="stylesheet" />
<!-- По умолчанию русский язык уже встроен -->
<script src="etersoft_typos_language-ru.js"></script>
<link type="text/css" href="stylesheet.css" rel="stylesheet" />
</head>
<body>
<!-- Этот js вставляе в страницу -->
<script type='text/javascript'>
window.onload = function() {
var typos = new ETYPOS();
......@@ -23,14 +29,19 @@
};
}
</script>
<!-- end -->
<!-- Этот html-код вставляем на страницу -->
<div class="e_typos_div">
<div class="e_typos_title">
<span>Сервис опечаток</span>
<span title="Закрыть окно" class="e_typos_close"><b>х</b></span>
</div>
<p class="e_typos_desc">Выделите текст и нажмите кнопку "Отправить"</p>
<p class="e_typos_desc">
Вы выделили:
<b class='e_typos_desc_text'></b>
</p>
<p>
<nobr>Комментарий: <input type="text" class="e_typos_comment" size='19' maxlength="50" placeholder="Должна быть буква..."/></nobr>
......@@ -44,6 +55,7 @@
<input type="button" title="Закрыть окно" value="Закрыть" class="e_typos_button e_typos_close" />
</p>
</div>
<!-- end -->
<div>
Казахста́н (официально Респу́блика Казахста́н, каз. Қазақстан [qɑzɑqˈstɑn]) — государство, располагающееся в центре Евразии, бо́льшая часть которого относится к Азии, а меньшая — к Европе, Казахстан располагается между Каспийским морем, Нижним Поволжьем, Уралом, Сибирью, Китаем и Средней Азией.
......
<?xml version="1.0"?>
<bindings
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="ellipsis">
<content>
<xul:window><!-- xul:window tag required for FF2 -->
<xul:description crop="end" xbl:inherits="value=xbl:text"><children/></xul:description>
</xul:window>
</content>
</binding>
</bindings>
<?xml version="1.0"?>
<bindings
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="ellipsis">
<content>
<xul:window><!-- xul:window tag required for FF2 -->
<xul:description crop="end" xbl:inherits="value=xbl:text"><children/></xul:description>
</xul:window>
</content>
</binding>
</bindings>
Installation
Download the jqGrid package from the www.trirand/blog site section downloads.
Note the new download manager where you can choose which modules you want to
include in the download.
In order to use jqGrid 3.5, first a UI theme css file should be loaded.
Download the desired theme (or build a custom one) from jQueryUI site
(www.jqueryui.com) and point in your link tag in head section the path to the
theme css
<link rel="stylesheet" type="text/css" media="screen" href="path_to_ui_css_file/jquery-ui-1.7.1.custom.css" />
where the path_to_ui_css_file is a valid path to the ui theme file
Extract the jqGrid package and copy the ui.jqgrid.css from css directory to
your webserver directory. It is not necessary that the jqgrid css file is in
the same directory as those of the jquery ui css.
<link rel="stylesheet" type="text/css" media="screen" href="path_to_jqgrid_css_file/ui.jqgrid.css" />
Starting with this version, jqGrid does not use a loader (which loads the
needed files one by one), but all the needed code is contained in one file.
The desired modules can be built using the jqGrid download manager from the
site pointed above. In order to use this, first a language file should be
loaded and then the jqgrid file.
Copy the desired language file from js/i18n directory to your web server
directory where you store the java script files. Every language file is
named grid.locale-XX.js, where XX is a two-letter code for the language.
Copy the jquery.jqGid.min.js file to the same or other valid directory in
your web server
Include both the files in script tags in the head section
<script src="path_to_js_files/grid.locale-en.js" type="text/javascript"></script>
<script src="path_to_js_files/jquery.jqGrid.min.js" type="text/javascript"></script>
For debugging purposes, I have created a grid.loader.js which does the same
loading of the files as in previous versions. The location of the file is in
src directory of the package. In order to use this, the variable pathojsfiles
should be adjusted to point to the appropriate folder - see 3.4.x docs.
Installation
Download the jqGrid package from the www.trirand/blog site section downloads.
Note the new download manager where you can choose which modules you want to
include in the download.
In order to use jqGrid 3.5, first a UI theme css file should be loaded.
Download the desired theme (or build a custom one) from jQueryUI site
(www.jqueryui.com) and point in your link tag in head section the path to the
theme css
<link rel="stylesheet" type="text/css" media="screen" href="path_to_ui_css_file/jquery-ui-1.7.1.custom.css" />
where the path_to_ui_css_file is a valid path to the ui theme file
Extract the jqGrid package and copy the ui.jqgrid.css from css directory to
your webserver directory. It is not necessary that the jqgrid css file is in
the same directory as those of the jquery ui css.
<link rel="stylesheet" type="text/css" media="screen" href="path_to_jqgrid_css_file/ui.jqgrid.css" />
Starting with this version, jqGrid does not use a loader (which loads the
needed files one by one), but all the needed code is contained in one file.
The desired modules can be built using the jqGrid download manager from the
site pointed above. In order to use this, first a language file should be
loaded and then the jqgrid file.
Copy the desired language file from js/i18n directory to your web server
directory where you store the java script files. Every language file is
named grid.locale-XX.js, where XX is a two-letter code for the language.
Copy the jquery.jqGid.min.js file to the same or other valid directory in
your web server
Include both the files in script tags in the head section
<script src="path_to_js_files/grid.locale-en.js" type="text/javascript"></script>
<script src="path_to_js_files/jquery.jqGrid.min.js" type="text/javascript"></script>
For debugging purposes, I have created a grid.loader.js which does the same
loading of the files as in previous versions. The location of the file is in
src directory of the package. In order to use this, the variable pathojsfiles
should be adjusted to point to the appropriate folder - see 3.4.x docs.
This source diff could not be displayed because it is too large. You can view the blob instead.
;(function($){
/**
* jqGrid extension
* Paul Tiseo ptiseo@wasteconsultants.com
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl-2.0.html
**/
$.jgrid.extend({
getPostData : function(){
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.postData;
},
setPostData : function( newdata ) {
var $t = this[0];
if(!$t.grid) { return; }
// check if newdata is correct type
if ( typeof(newdata) === 'object' ) {
$t.p.postData = newdata;
}
else {
alert("Error: cannot add a non-object postData value. postData unchanged.");
}
},
appendPostData : function( newdata ) {
var $t = this[0];
if(!$t.grid) { return; }
// check if newdata is correct type
if ( typeof(newdata) === 'object' ) {
$.extend($t.p.postData, newdata);
}
else {
alert("Error: cannot append a non-object postData value. postData unchanged.");
}
},
setPostDataItem : function( key, val ) {
var $t = this[0];
if(!$t.grid) { return; }
$t.p.postData[key] = val;
},
getPostDataItem : function( key ) {
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.postData[key];
},
removePostDataItem : function( key ) {
var $t = this[0];
if(!$t.grid) { return; }
delete $t.p.postData[key];
},
getUserData : function(){
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.userData;
},
getUserDataItem : function( key ) {
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.userData[key];
}
});
;(function($){
/**
* jqGrid extension
* Paul Tiseo ptiseo@wasteconsultants.com
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl-2.0.html
**/
$.jgrid.extend({
getPostData : function(){
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.postData;
},
setPostData : function( newdata ) {
var $t = this[0];
if(!$t.grid) { return; }
// check if newdata is correct type
if ( typeof(newdata) === 'object' ) {
$t.p.postData = newdata;
}
else {
alert("Error: cannot add a non-object postData value. postData unchanged.");
}
},
appendPostData : function( newdata ) {
var $t = this[0];
if(!$t.grid) { return; }
// check if newdata is correct type
if ( typeof(newdata) === 'object' ) {
$.extend($t.p.postData, newdata);
}
else {
alert("Error: cannot append a non-object postData value. postData unchanged.");
}
},
setPostDataItem : function( key, val ) {
var $t = this[0];
if(!$t.grid) { return; }
$t.p.postData[key] = val;
},
getPostDataItem : function( key ) {
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.postData[key];
},
removePostDataItem : function( key ) {
var $t = this[0];
if(!$t.grid) { return; }
delete $t.p.postData[key];
},
getUserData : function(){
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.userData;
},
getUserDataItem : function( key ) {
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.userData[key];
}
});
})(jQuery);
\ No newline at end of file
/*
* ContextMenu - jQuery plugin for right-click context menus
*
* Author: Chris Domigan
* Contributors: Dan G. Switzer, II
* Parts of this plugin are inspired by Joern Zaefferer's Tooltip plugin
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Version: r2
* Date: 16 July 2007
*
* For documentation visit http://www.trendskitchens.co.nz/jquery/contextmenu/
*
*/
(function($) {
var menu, shadow, content, hash, currentTarget;
var defaults = {
menuStyle: {
listStyle: 'none',
padding: '1px',
margin: '0px',
backgroundColor: '#fff',
border: '1px solid #999',
width: '100px'
},
itemStyle: {
margin: '0px',
color: '#000',
display: 'block',
cursor: 'default',
padding: '3px',
border: '1px solid #fff',
backgroundColor: 'transparent'
},
itemHoverStyle: {
border: '1px solid #0a246a',
backgroundColor: '#b6bdd2'
},
eventPosX: 'pageX',
eventPosY: 'pageY',
shadow : true,
onContextMenu: null,
onShowMenu: null
};
$.fn.contextMenu = function(id, options) {
if (!menu) { // Create singleton menu
menu = $('<div id="jqContextMenu"></div>')
.hide()
.css({position:'absolute', zIndex:'500'})
.appendTo('body')
.bind('click', function(e) {
e.stopPropagation();
});
}
if (!shadow) {
shadow = $('<div></div>')
.css({backgroundColor:'#000',position:'absolute',opacity:0.2,zIndex:499})
.appendTo('body')
.hide();
}
hash = hash || [];
hash.push({
id : id,
menuStyle: $.extend({}, defaults.menuStyle, options.menuStyle || {}),
itemStyle: $.extend({}, defaults.itemStyle, options.itemStyle || {}),
itemHoverStyle: $.extend({}, defaults.itemHoverStyle, options.itemHoverStyle || {}),
bindings: options.bindings || {},
shadow: options.shadow || options.shadow === false ? options.shadow : defaults.shadow,
onContextMenu: options.onContextMenu || defaults.onContextMenu,
onShowMenu: options.onShowMenu || defaults.onShowMenu,
eventPosX: options.eventPosX || defaults.eventPosX,
eventPosY: options.eventPosY || defaults.eventPosY
});
var index = hash.length - 1;
$(this).bind('contextmenu', function(e) {
// Check if onContextMenu() defined
var bShowContext = (!!hash[index].onContextMenu) ? hash[index].onContextMenu(e) : true;
currentTarget = e.target;
if (bShowContext) {
display(index, this, e );
return false;
}
});
return this;
};
function display(index, trigger, e ) {
var cur = hash[index];
content = $('#'+cur.id).find('ul:first').clone(true);
content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover(
function() {
$(this).css(cur.itemHoverStyle);
},
function(){
$(this).css(cur.itemStyle);
}
).find('img').css({verticalAlign:'middle',paddingRight:'2px'});
// Send the content to the menu
menu.html(content);
// if there's an onShowMenu, run it now -- must run after content has been added
// if you try to alter the content variable before the menu.html(), IE6 has issues
// updating the content
if (!!cur.onShowMenu) menu = cur.onShowMenu(e, menu);
$.each(cur.bindings, function(id, func) {
$('#'+id, menu).bind('click', function() {
hide();
func(trigger, currentTarget);
});
});
menu.css({'left':e[cur.eventPosX],'top':e[cur.eventPosY]}).show();
if (cur.shadow) shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2,top:e.pageY+2}).show();
$(document).one('click', hide);
}
function hide() {
menu.hide();
shadow.hide();
}
// Apply defaults
$.contextMenu = {
defaults : function(userDefaults) {
$.each(userDefaults, function(i, val) {
if (typeof val == 'object' && defaults[i]) {
$.extend(defaults[i], val);
}
else defaults[i] = val;
});
}
};
})(jQuery);
$(function() {
$('div.contextMenu').hide();
/*
* ContextMenu - jQuery plugin for right-click context menus
*
* Author: Chris Domigan
* Contributors: Dan G. Switzer, II
* Parts of this plugin are inspired by Joern Zaefferer's Tooltip plugin
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Version: r2
* Date: 16 July 2007
*
* For documentation visit http://www.trendskitchens.co.nz/jquery/contextmenu/
*
*/
(function($) {
var menu, shadow, content, hash, currentTarget;
var defaults = {
menuStyle: {
listStyle: 'none',
padding: '1px',
margin: '0px',
backgroundColor: '#fff',
border: '1px solid #999',
width: '100px'
},
itemStyle: {
margin: '0px',
color: '#000',
display: 'block',
cursor: 'default',
padding: '3px',
border: '1px solid #fff',
backgroundColor: 'transparent'
},
itemHoverStyle: {
border: '1px solid #0a246a',
backgroundColor: '#b6bdd2'
},
eventPosX: 'pageX',
eventPosY: 'pageY',
shadow : true,
onContextMenu: null,
onShowMenu: null
};
$.fn.contextMenu = function(id, options) {
if (!menu) { // Create singleton menu
menu = $('<div id="jqContextMenu"></div>')
.hide()
.css({position:'absolute', zIndex:'500'})
.appendTo('body')
.bind('click', function(e) {
e.stopPropagation();
});
}
if (!shadow) {
shadow = $('<div></div>')
.css({backgroundColor:'#000',position:'absolute',opacity:0.2,zIndex:499})
.appendTo('body')
.hide();
}
hash = hash || [];
hash.push({
id : id,
menuStyle: $.extend({}, defaults.menuStyle, options.menuStyle || {}),
itemStyle: $.extend({}, defaults.itemStyle, options.itemStyle || {}),
itemHoverStyle: $.extend({}, defaults.itemHoverStyle, options.itemHoverStyle || {}),
bindings: options.bindings || {},
shadow: options.shadow || options.shadow === false ? options.shadow : defaults.shadow,
onContextMenu: options.onContextMenu || defaults.onContextMenu,
onShowMenu: options.onShowMenu || defaults.onShowMenu,
eventPosX: options.eventPosX || defaults.eventPosX,
eventPosY: options.eventPosY || defaults.eventPosY
});
var index = hash.length - 1;
$(this).bind('contextmenu', function(e) {
// Check if onContextMenu() defined
var bShowContext = (!!hash[index].onContextMenu) ? hash[index].onContextMenu(e) : true;
currentTarget = e.target;
if (bShowContext) {
display(index, this, e );
return false;
}
});
return this;
};
function display(index, trigger, e ) {
var cur = hash[index];
content = $('#'+cur.id).find('ul:first').clone(true);
content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover(
function() {
$(this).css(cur.itemHoverStyle);
},
function(){
$(this).css(cur.itemStyle);
}
).find('img').css({verticalAlign:'middle',paddingRight:'2px'});
// Send the content to the menu
menu.html(content);
// if there's an onShowMenu, run it now -- must run after content has been added
// if you try to alter the content variable before the menu.html(), IE6 has issues
// updating the content
if (!!cur.onShowMenu) menu = cur.onShowMenu(e, menu);
$.each(cur.bindings, function(id, func) {
$('#'+id, menu).bind('click', function() {
hide();
func(trigger, currentTarget);
});
});
menu.css({'left':e[cur.eventPosX],'top':e[cur.eventPosY]}).show();
if (cur.shadow) shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2,top:e.pageY+2}).show();
$(document).one('click', hide);
}
function hide() {
menu.hide();
shadow.hide();
}
// Apply defaults
$.contextMenu = {
defaults : function(userDefaults) {
$.each(userDefaults, function(i, val) {
if (typeof val == 'object' && defaults[i]) {
$.extend(defaults[i], val);
}
else defaults[i] = val;
});
}
};
})(jQuery);
$(function() {
$('div.contextMenu').hide();
});
\ No newline at end of file
.ui-searchFilter { display: none; position: absolute; z-index: 770; overflow: visible;}
.ui-searchFilter table {position:relative; margin:0em; width:auto}
.ui-searchFilter table td {margin: 0em; padding: 1px;}
.ui-searchFilter table td input, .ui-searchFilter table td select {margin: 0.1em;}
.ui-searchFilter .ui-state-default { cursor: pointer; }
.ui-searchFilter { display: none; position: absolute; z-index: 770; overflow: visible;}
.ui-searchFilter table {position:relative; margin:0em; width:auto}
.ui-searchFilter table td {margin: 0em; padding: 1px;}
.ui-searchFilter table td input, .ui-searchFilter table td select {margin: 0.1em;}
.ui-searchFilter .ui-state-default { cursor: pointer; }
.ui-searchFilter .divider hr {margin: 1px; }
\ No newline at end of file
/* Multiselect
----------------------------------*/
.ui-multiselect { border: solid 1px; font-size: 0.8em; }
.ui-multiselect ul { -moz-user-select: none; }
.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; }
.ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;}
.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; }
.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; }
.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; }
.ui-multiselect ul.selected li { }
.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; }
.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; }
.ui-multiselect ul.available li { padding-left: 10px; }
.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;}
.ui-multiselect .ui-state-hover { border: none; }
.ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;}
.ui-multiselect .add-all { float: right; padding: 7px;}
.ui-multiselect .remove-all { float: right; padding: 7px;}
.ui-multiselect .search { float: left; padding: 4px;}
.ui-multiselect .count { float: left; padding: 7px;}
.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; }
.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; }
/* Multiselect
----------------------------------*/
.ui-multiselect { border: solid 1px; font-size: 0.8em; }
.ui-multiselect ul { -moz-user-select: none; }
.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; }
.ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;}
.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; }
.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; }
.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; }
.ui-multiselect ul.selected li { }
.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; }
.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; }
.ui-multiselect ul.available li { padding-left: 10px; }
.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;}
.ui-multiselect .ui-state-hover { border: none; }
.ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;}
.ui-multiselect .add-all { float: right; padding: 7px;}
.ui-multiselect .remove-all { float: right; padding: 7px;}
.ui-multiselect .search { float: left; padding: 4px;}
.ui-multiselect .count { float: left; padding: 7px;}
.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; }
.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; }
.ui-multiselect input.search { height: 14px; padding: 1px; opacity: 0.5; margin: 4px; width: 100px; }
\ No newline at end of file
<?xml version="1.0"?>
<bindings
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="ellipsis">
<content>
<xul:window><!-- xul:window tag required for FF2 -->
<xul:description crop="end" xbl:inherits="value=xbl:text"><children/></xul:description>
</xul:window>
</content>
</binding>
</bindings>
<?xml version="1.0"?>
<bindings
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="ellipsis">
<content>
<xul:window><!-- xul:window tag required for FF2 -->
<xul:description crop="end" xbl:inherits="value=xbl:text"><children/></xul:description>
</xul:window>
</content>
</binding>
</bindings>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
//This file should be used if you want to debug and develop
function jqGridInclude()
{
var pathtojsfiles = "js/"; // need to be ajusted
// set include to false if you do not want some modules to be included
var modules = [
{ include: true, incfile:'i18n/grid.locale-en.js'}, // jqGrid translation
{ include: true, incfile:'grid.base.js'}, // jqGrid base
{ include: true, incfile:'grid.common.js'}, // jqGrid common for editing
{ include: true, incfile:'grid.formedit.js'}, // jqGrid Form editing
{ include: true, incfile:'grid.inlinedit.js'}, // jqGrid inline editing
{ include: true, incfile:'grid.celledit.js'}, // jqGrid cell editing
{ include: true, incfile:'grid.subgrid.js'}, //jqGrid subgrid
{ include: true, incfile:'grid.treegrid.js'}, //jqGrid treegrid
{ include: true, incfile:'grid.grouping.js'}, //jqGrid grouping
{ include: true, incfile:'grid.custom.js'}, //jqGrid custom
{ include: true, incfile:'grid.tbltogrid.js'}, //jqGrid table to grid
{ include: true, incfile:'grid.import.js'}, //jqGrid import
{ include: true, incfile:'jquery.fmatter.js'}, //jqGrid formater
{ include: true, incfile:'JsonXml.js'}, //xmljson utils
{ include: true, incfile:'grid.jqueryui.js'}, //jQuery UI utils
{ include: true, incfile:'grid.filter.js'} // filter Plugin
];
var filename;
for(var i=0;i<modules.length; i++)
{
if(modules[i].include === true) {
filename = pathtojsfiles+modules[i].incfile;
if(jQuery.browser.safari) {
jQuery.ajax({url:filename,dataType:'script', async:false, cache: true});
} else {
if (jQuery.browser.msie) {
document.write('<script charset="utf-8" type="text/javascript" src="'+filename+'"></script>');
} else {
IncludeJavaScript(filename);
}
}
}
}
function IncludeJavaScript(jsFile)
{
var oHead = document.getElementsByTagName('head')[0];
var oScript = document.createElement('script');
oScript.setAttribute('type', 'text/javascript');
oScript.setAttribute('language', 'javascript');
oScript.setAttribute('src', jsFile);
oHead.appendChild(oScript);
}
}
jqGridInclude();
//This file should be used if you want to debug and develop
function jqGridInclude()
{
var pathtojsfiles = "js/"; // need to be ajusted
// set include to false if you do not want some modules to be included
var modules = [
{ include: true, incfile:'i18n/grid.locale-en.js'}, // jqGrid translation
{ include: true, incfile:'grid.base.js'}, // jqGrid base
{ include: true, incfile:'grid.common.js'}, // jqGrid common for editing
{ include: true, incfile:'grid.formedit.js'}, // jqGrid Form editing
{ include: true, incfile:'grid.inlinedit.js'}, // jqGrid inline editing
{ include: true, incfile:'grid.celledit.js'}, // jqGrid cell editing
{ include: true, incfile:'grid.subgrid.js'}, //jqGrid subgrid
{ include: true, incfile:'grid.treegrid.js'}, //jqGrid treegrid
{ include: true, incfile:'grid.grouping.js'}, //jqGrid grouping
{ include: true, incfile:'grid.custom.js'}, //jqGrid custom
{ include: true, incfile:'grid.tbltogrid.js'}, //jqGrid table to grid
{ include: true, incfile:'grid.import.js'}, //jqGrid import
{ include: true, incfile:'jquery.fmatter.js'}, //jqGrid formater
{ include: true, incfile:'JsonXml.js'}, //xmljson utils
{ include: true, incfile:'grid.jqueryui.js'}, //jQuery UI utils
{ include: true, incfile:'grid.filter.js'} // filter Plugin
];
var filename;
for(var i=0;i<modules.length; i++)
{
if(modules[i].include === true) {
filename = pathtojsfiles+modules[i].incfile;
if(jQuery.browser.safari) {
jQuery.ajax({url:filename,dataType:'script', async:false, cache: true});
} else {
if (jQuery.browser.msie) {
document.write('<script charset="utf-8" type="text/javascript" src="'+filename+'"></script>');
} else {
IncludeJavaScript(filename);
}
}
}
}
function IncludeJavaScript(jsFile)
{
var oHead = document.getElementsByTagName('head')[0];
var oScript = document.createElement('script');
oScript.setAttribute('type', 'text/javascript');
oScript.setAttribute('language', 'javascript');
oScript.setAttribute('src', jsFile);
oHead.appendChild(oScript);
}
}
jqGridInclude();
/*
Transform a table to a jqGrid.
Peter Romianowski <peter.romianowski@optivo.de>
If the first column of the table contains checkboxes or
radiobuttons then the jqGrid is made selectable.
*/
// Addition - selector can be a class or id
function tableToGrid(selector, options) {
jQuery(selector).each(function() {
if(this.grid) {return;} //Adedd from Tony Tomov
// This is a small "hack" to make the width of the jqGrid 100%
jQuery(this).width("99%");
var w = jQuery(this).width();
// Text whether we have single or multi select
var inputCheckbox = jQuery('tr td:first-child input[type=checkbox]:first', jQuery(this));
var inputRadio = jQuery('tr td:first-child input[type=radio]:first', jQuery(this));
var selectMultiple = inputCheckbox.length > 0;
var selectSingle = !selectMultiple && inputRadio.length > 0;
var selectable = selectMultiple || selectSingle;
//var inputName = inputCheckbox.attr("name") || inputRadio.attr("name");
// Build up the columnModel and the data
var colModel = [];
var colNames = [];
jQuery('th', jQuery(this)).each(function() {
if (colModel.length === 0 && selectable) {
colModel.push({
name: '__selection__',
index: '__selection__',
width: 0,
hidden: true
});
colNames.push('__selection__');
} else {
colModel.push({
name: jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(' ').join('_'),
index: jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(' ').join('_'),
width: jQuery(this).width() || 150
});
colNames.push(jQuery(this).html());
}
});
var data = [];
var rowIds = [];
var rowChecked = [];
jQuery('tbody > tr', jQuery(this)).each(function() {
var row = {};
var rowPos = 0;
jQuery('td', jQuery(this)).each(function() {
if (rowPos === 0 && selectable) {
var input = jQuery('input', jQuery(this));
var rowId = input.attr("value");
rowIds.push(rowId || data.length);
if (input.is(":checked")) {
rowChecked.push(rowId);
}
row[colModel[rowPos].name] = input.attr("value");
} else {
row[colModel[rowPos].name] = jQuery(this).html();
}
rowPos++;
});
if(rowPos >0) { data.push(row); }
});
// Clear the original HTML table
jQuery(this).empty();
// Mark it as jqGrid
jQuery(this).addClass("scroll");
jQuery(this).jqGrid(jQuery.extend({
datatype: "local",
width: w,
colNames: colNames,
colModel: colModel,
multiselect: selectMultiple
//inputName: inputName,
//inputValueCol: imputName != null ? "__selection__" : null
}, options || {}));
// Add data
var a;
for (a = 0; a < data.length; a++) {
var id = null;
if (rowIds.length > 0) {
id = rowIds[a];
if (id && id.replace) {
// We have to do this since the value of a checkbox
// or radio button can be anything
id = encodeURIComponent(id).replace(/[.\-%]/g, "_");
}
}
if (id === null) {
id = a + 1;
}
jQuery(this).jqGrid("addRowData",id, data[a]);
}
// Set the selection
for (a = 0; a < rowChecked.length; a++) {
jQuery(this).jqGrid("setSelection",rowChecked[a]);
}
});
};
/*
Transform a table to a jqGrid.
Peter Romianowski <peter.romianowski@optivo.de>
If the first column of the table contains checkboxes or
radiobuttons then the jqGrid is made selectable.
*/
// Addition - selector can be a class or id
function tableToGrid(selector, options) {
jQuery(selector).each(function() {
if(this.grid) {return;} //Adedd from Tony Tomov
// This is a small "hack" to make the width of the jqGrid 100%
jQuery(this).width("99%");
var w = jQuery(this).width();
// Text whether we have single or multi select
var inputCheckbox = jQuery('tr td:first-child input[type=checkbox]:first', jQuery(this));
var inputRadio = jQuery('tr td:first-child input[type=radio]:first', jQuery(this));
var selectMultiple = inputCheckbox.length > 0;
var selectSingle = !selectMultiple && inputRadio.length > 0;
var selectable = selectMultiple || selectSingle;
//var inputName = inputCheckbox.attr("name") || inputRadio.attr("name");
// Build up the columnModel and the data
var colModel = [];
var colNames = [];
jQuery('th', jQuery(this)).each(function() {
if (colModel.length === 0 && selectable) {
colModel.push({
name: '__selection__',
index: '__selection__',
width: 0,
hidden: true
});
colNames.push('__selection__');
} else {
colModel.push({
name: jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(' ').join('_'),
index: jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(' ').join('_'),
width: jQuery(this).width() || 150
});
colNames.push(jQuery(this).html());
}
});
var data = [];
var rowIds = [];
var rowChecked = [];
jQuery('tbody > tr', jQuery(this)).each(function() {
var row = {};
var rowPos = 0;
jQuery('td', jQuery(this)).each(function() {
if (rowPos === 0 && selectable) {
var input = jQuery('input', jQuery(this));
var rowId = input.attr("value");
rowIds.push(rowId || data.length);
if (input.is(":checked")) {
rowChecked.push(rowId);
}
row[colModel[rowPos].name] = input.attr("value");
} else {
row[colModel[rowPos].name] = jQuery(this).html();
}
rowPos++;
});
if(rowPos >0) { data.push(row); }
});
// Clear the original HTML table
jQuery(this).empty();
// Mark it as jqGrid
jQuery(this).addClass("scroll");
jQuery(this).jqGrid(jQuery.extend({
datatype: "local",
width: w,
colNames: colNames,
colModel: colModel,
multiselect: selectMultiple
//inputName: inputName,
//inputValueCol: imputName != null ? "__selection__" : null
}, options || {}));
// Add data
var a;
for (a = 0; a < data.length; a++) {
var id = null;
if (rowIds.length > 0) {
id = rowIds[a];
if (id && id.replace) {
// We have to do this since the value of a checkbox
// or radio button can be anything
id = encodeURIComponent(id).replace(/[.\-%]/g, "_");
}
}
if (id === null) {
id = a + 1;
}
jQuery(this).jqGrid("addRowData",id, data[a]);
}
// Set the selection
for (a = 0; a < rowChecked.length; a++) {
jQuery(this).jqGrid("setSelection",rowChecked[a]);
}
});
};
/*
* jqDnR - Minimalistic Drag'n'Resize for jQuery.
*
* Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* $Version: 2007.08.19 +r2
*/
(function($){
$.fn.jqDrag=function(h){return i(this,h,'d');};
$.fn.jqResize=function(h,ar){return i(this,h,'r',ar);};
$.jqDnR={
dnr:{},
e:0,
drag:function(v){
if(M.k == 'd'){E.css({left:M.X+v.pageX-M.pX,top:M.Y+v.pageY-M.pY});}
else {
E.css({width:Math.max(v.pageX-M.pX+M.W,0),height:Math.max(v.pageY-M.pY+M.H,0)});
if(M1){E1.css({width:Math.max(v.pageX-M1.pX+M1.W,0),height:Math.max(v.pageY-M1.pY+M1.H,0)});}
}
return false;
},
stop:function(){
//E.css('opacity',M.o);
$(document).unbind('mousemove',J.drag).unbind('mouseup',J.stop);
}
};
var J=$.jqDnR,M=J.dnr,E=J.e,E1,M1,
i=function(e,h,k,aR){
return e.each(function(){
h=(h)?$(h,e):e;
h.bind('mousedown',{e:e,k:k},function(v){
var d=v.data,p={};E=d.e;E1 = aR ? $(aR) : false;
// attempt utilization of dimensions plugin to fix IE issues
if(E.css('position') != 'relative'){try{E.position(p);}catch(e){}}
M={
X:p.left||f('left')||0,
Y:p.top||f('top')||0,
W:f('width')||E[0].scrollWidth||0,
H:f('height')||E[0].scrollHeight||0,
pX:v.pageX,
pY:v.pageY,
k:d.k
//o:E.css('opacity')
};
// also resize
if(E1 && d.k != 'd'){
M1={
X:p.left||f1('left')||0,
Y:p.top||f1('top')||0,
W:E1[0].offsetWidth||f1('width')||0,
H:E1[0].offsetHeight||f1('height')||0,
pX:v.pageX,
pY:v.pageY,
k:d.k
};
} else {M1 = false;}
//E.css({opacity:0.8});
if($("input.hasDatepicker",E[0])[0]) {
try {$("input.hasDatepicker",E[0]).datepicker('hide');}catch (dpe){}
}
$(document).mousemove($.jqDnR.drag).mouseup($.jqDnR.stop);
return false;
});
});
},
f=function(k){return parseInt(E.css(k),10)||false;},
f1=function(k){return parseInt(E1.css(k),10)||false;};
/*
* jqDnR - Minimalistic Drag'n'Resize for jQuery.
*
* Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* $Version: 2007.08.19 +r2
*/
(function($){
$.fn.jqDrag=function(h){return i(this,h,'d');};
$.fn.jqResize=function(h,ar){return i(this,h,'r',ar);};
$.jqDnR={
dnr:{},
e:0,
drag:function(v){
if(M.k == 'd'){E.css({left:M.X+v.pageX-M.pX,top:M.Y+v.pageY-M.pY});}
else {
E.css({width:Math.max(v.pageX-M.pX+M.W,0),height:Math.max(v.pageY-M.pY+M.H,0)});
if(M1){E1.css({width:Math.max(v.pageX-M1.pX+M1.W,0),height:Math.max(v.pageY-M1.pY+M1.H,0)});}
}
return false;
},
stop:function(){
//E.css('opacity',M.o);
$(document).unbind('mousemove',J.drag).unbind('mouseup',J.stop);
}
};
var J=$.jqDnR,M=J.dnr,E=J.e,E1,M1,
i=function(e,h,k,aR){
return e.each(function(){
h=(h)?$(h,e):e;
h.bind('mousedown',{e:e,k:k},function(v){
var d=v.data,p={};E=d.e;E1 = aR ? $(aR) : false;
// attempt utilization of dimensions plugin to fix IE issues
if(E.css('position') != 'relative'){try{E.position(p);}catch(e){}}
M={
X:p.left||f('left')||0,
Y:p.top||f('top')||0,
W:f('width')||E[0].scrollWidth||0,
H:f('height')||E[0].scrollHeight||0,
pX:v.pageX,
pY:v.pageY,
k:d.k
//o:E.css('opacity')
};
// also resize
if(E1 && d.k != 'd'){
M1={
X:p.left||f1('left')||0,
Y:p.top||f1('top')||0,
W:E1[0].offsetWidth||f1('width')||0,
H:E1[0].offsetHeight||f1('height')||0,
pX:v.pageX,
pY:v.pageY,
k:d.k
};
} else {M1 = false;}
//E.css({opacity:0.8});
if($("input.hasDatepicker",E[0])[0]) {
try {$("input.hasDatepicker",E[0]).datepicker('hide');}catch (dpe){}
}
$(document).mousemove($.jqDnR.drag).mouseup($.jqDnR.stop);
return false;
});
});
},
f=function(k){return parseInt(E.css(k),10)||false;},
f1=function(k){return parseInt(E1.css(k),10)||false;};
})(jQuery);
\ No newline at end of file
/*
* jqModal - Minimalist Modaling with jQuery
* (http://dev.iceburg.net/jquery/jqmodal/)
*
* Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* $Version: 07/06/2008 +r13
*/
(function($) {
$.fn.jqm=function(o){
var p={
overlay: 50,
closeoverlay : true,
overlayClass: 'jqmOverlay',
closeClass: 'jqmClose',
trigger: '.jqModal',
ajax: F,
ajaxText: '',
target: F,
modal: F,
toTop: F,
onShow: F,
onHide: F,
onLoad: F
};
return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
if(p.trigger)$(this).jqmAddTrigger(p.trigger);
});};
$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
$.fn.jqmShow=function(t){return this.each(function(){$.jqm.open(this._jqm,t);});};
$.fn.jqmHide=function(t){return this.each(function(){$.jqm.close(this._jqm,t)});};
$.jqm = {
hash:{},
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index')));z=(z>0)?z:3000;var o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
if(c.modal) {if(!A[0])setTimeout(function(){L('bind');},1);A.push(s);}
else if(c.overlay > 0) {if(c.closeoverlay) h.w.jqmAddClose(o);}
else o=F;
h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
if(c.ajax) {var r=c.target||h.w,u=c.ajax;r=(typeof r == 'string')?$(r,h.w):$(r);u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
else if(cc)h.w.jqmAddClose($(cc,h.w));
if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);
(c.onShow)?c.onShow(h):h.w.show();e(h);return F;
},
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
if(A[0]){A.pop();if(!A[0])L('unbind');}
if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
},
params:{}};
var s=0,H=$.jqm.hash,A=[],F=false,
e=function(h){f(h);},
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
L=function(t){$(document)[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r){$('.jqmID'+h.s).each(function(){var $self=$(this),offset=$self.offset();if(offset.top<=e.pageY && e.pageY<=offset.top+$self.height() && offset.left<=e.pageX && e.pageX<=offset.left+$self.width()){r=false;return false;}});f(h);}return !r;},
hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
/*
* jqModal - Minimalist Modaling with jQuery
* (http://dev.iceburg.net/jquery/jqmodal/)
*
* Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* $Version: 07/06/2008 +r13
*/
(function($) {
$.fn.jqm=function(o){
var p={
overlay: 50,
closeoverlay : true,
overlayClass: 'jqmOverlay',
closeClass: 'jqmClose',
trigger: '.jqModal',
ajax: F,
ajaxText: '',
target: F,
modal: F,
toTop: F,
onShow: F,
onHide: F,
onLoad: F
};
return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
if(p.trigger)$(this).jqmAddTrigger(p.trigger);
});};
$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
$.fn.jqmShow=function(t){return this.each(function(){$.jqm.open(this._jqm,t);});};
$.fn.jqmHide=function(t){return this.each(function(){$.jqm.close(this._jqm,t)});};
$.jqm = {
hash:{},
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index')));z=(z>0)?z:3000;var o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
if(c.modal) {if(!A[0])setTimeout(function(){L('bind');},1);A.push(s);}
else if(c.overlay > 0) {if(c.closeoverlay) h.w.jqmAddClose(o);}
else o=F;
h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
if(c.ajax) {var r=c.target||h.w,u=c.ajax;r=(typeof r == 'string')?$(r,h.w):$(r);u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
else if(cc)h.w.jqmAddClose($(cc,h.w));
if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);
(c.onShow)?c.onShow(h):h.w.show();e(h);return F;
},
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
if(A[0]){A.pop();if(!A[0])L('unbind');}
if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
},
params:{}};
var s=0,H=$.jqm.hash,A=[],F=false,
e=function(h){f(h);},
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
L=function(t){$(document)[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r){$('.jqmID'+h.s).each(function(){var $self=$(this),offset=$self.offset();if(offset.top<=e.pageY && e.pageY<=offset.top+$self.height() && offset.left<=e.pageX && e.pageX<=offset.left+$self.width()){r=false;return false;}});f(h);}return !r;},
hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
})(jQuery);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<div style="font-size:12px;">
In 3.6 we have done so that the developer can controll full the ajax requests to the server. For this purpose<br>
we created a 3 level of settings <br/>
1. common ajax settings for all modules that use ajax requests <br/>
2. specific ajax settings for every module<br/>
3. serialize function which can be used to serialize the data to the server in a way that the developer want<br/>
In this example we set the grid to use a POST to the server and in the serialize function we set the things so<br>
that only the first page should be returned<br>
<br />
<table id="jqgajax"></table>
<div id="pjqgajax"></div>
<script src="36ajaxing.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="jqgajax"></table>
<div id="jqgajax"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#jqgajax").jqGrid({
ajaxGridOptions : {type:"POST"},
serializeGridData : function(postdata) {
postdata.page = 1;
return postdata;
},
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pjqgajax',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#pjqgajax").jqGrid('navGrid','#pjqgajax',{edit:false,add:false,del:false});
</XMP>
<div style="font-size:12px;">
In 3.6 we have done so that the developer can controll full the ajax requests to the server. For this purpose<br>
we created a 3 level of settings <br/>
1. common ajax settings for all modules that use ajax requests <br/>
2. specific ajax settings for every module<br/>
3. serialize function which can be used to serialize the data to the server in a way that the developer want<br/>
In this example we set the grid to use a POST to the server and in the serialize function we set the things so<br>
that only the first page should be returned<br>
<br />
<table id="jqgajax"></table>
<div id="pjqgajax"></div>
<script src="36ajaxing.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="jqgajax"></table>
<div id="jqgajax"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#jqgajax").jqGrid({
ajaxGridOptions : {type:"POST"},
serializeGridData : function(postdata) {
postdata.page = 1;
return postdata;
},
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pjqgajax',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#pjqgajax").jqGrid('navGrid','#pjqgajax',{edit:false,add:false,del:false});
</XMP>
</div>
\ No newline at end of file
jQuery("#jqgajax").jqGrid({
ajaxGridOptions : {type:"POST"},
serializeGridData : function(postdata) {
postdata.page = 1;
return postdata;
},
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pjqgajax',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#pjqgajax").jqGrid('navGrid','#pjqgajax',{edit:false,add:false,del:false});
jQuery("#jqgajax").jqGrid({
ajaxGridOptions : {type:"POST"},
serializeGridData : function(postdata) {
postdata.page = 1;
return postdata;
},
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pjqgajax',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#pjqgajax").jqGrid('navGrid','#pjqgajax',{edit:false,add:false,del:false});
<div style="font-size:12px;">
Thanks to Mark Williams we have another great feature - Column Reordering.<br>
This is done again just with setting one options - sortable. Click on header column and try to move it to another location.<br>
This feature depend on jQuery UI sortable widget.<br>
Since we have other great stuffs which are depend on jQuery UI we have created a separated module<br>
grid.jqueryui.js
<br />
<table id="colr"></table>
<div id="pcolr"></div>
<script src="36colreorder.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="colr"></table>
<div id="pcolr"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#colr").jqGrid({
sortable: true,
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcolr',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Column Reordering Example"
});
jQuery("#colr").jqGrid('navGrid','#pcolr',{add:false,edit:false,del:false});
</XMP>
<div style="font-size:12px;">
Thanks to Mark Williams we have another great feature - Column Reordering.<br>
This is done again just with setting one options - sortable. Click on header column and try to move it to another location.<br>
This feature depend on jQuery UI sortable widget.<br>
Since we have other great stuffs which are depend on jQuery UI we have created a separated module<br>
grid.jqueryui.js
<br />
<table id="colr"></table>
<div id="pcolr"></div>
<script src="36colreorder.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="colr"></table>
<div id="pcolr"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#colr").jqGrid({
sortable: true,
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcolr',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Column Reordering Example"
});
jQuery("#colr").jqGrid('navGrid','#pcolr',{add:false,edit:false,del:false});
</XMP>
</div>
\ No newline at end of file
jQuery("#colr").jqGrid({
sortable: true,
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcolr',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Column Reordering Example"
});
jQuery("#colr").jqGrid('navGrid','#pcolr',{add:false,edit:false,del:false});
jQuery("#colr").jqGrid({
sortable: true,
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcolr',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Column Reordering Example"
});
jQuery("#colr").jqGrid('navGrid','#pcolr',{add:false,edit:false,del:false});
<div style="font-size:12px;">
Thanks again to Mark Williams we have other great feature - Column Chooser and Reordering.<br>
This is done with a simple method call like jQuery("#colch").jqGrid('columnChooser');<br>
This feature depend on jQuery UI sortable widget, jQuery UI dilog widget <br/>
and multiselect plugin provided from Michael Aufreiter and Yanick Rochon.<br/>
Click on Columns button in the navigator and enjoy.<br/>
<br />
<table id="colch"></table>
<div id="pcolch"></div>
<script src="36columnchoice.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="colch"></table>
<div id="pcolch"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#colch").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false, hidden:true}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pcolch',
sortname: 'invdate',
shrinkToFit :false,
viewrecords: true,
sortorder: "desc",
caption:"Column Chooser Example"
});
jQuery("#colch").jqGrid('navGrid','#pcolch',{add:false,edit:false,del:false,search:false,refresh:false});
jQuery("#colch").jqGrid('navButtonAdd','#pcolch',{
caption: "Columns",
title: "Reorder Columns",
onClickButton : function (){
jQuery("#colch").jqGrid('columnChooser');
}
});
</XMP>
<div style="font-size:12px;">
Thanks again to Mark Williams we have other great feature - Column Chooser and Reordering.<br>
This is done with a simple method call like jQuery("#colch").jqGrid('columnChooser');<br>
This feature depend on jQuery UI sortable widget, jQuery UI dilog widget <br/>
and multiselect plugin provided from Michael Aufreiter and Yanick Rochon.<br/>
Click on Columns button in the navigator and enjoy.<br/>
<br />
<table id="colch"></table>
<div id="pcolch"></div>
<script src="36columnchoice.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="colch"></table>
<div id="pcolch"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#colch").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false, hidden:true}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pcolch',
sortname: 'invdate',
shrinkToFit :false,
viewrecords: true,
sortorder: "desc",
caption:"Column Chooser Example"
});
jQuery("#colch").jqGrid('navGrid','#pcolch',{add:false,edit:false,del:false,search:false,refresh:false});
jQuery("#colch").jqGrid('navButtonAdd','#pcolch',{
caption: "Columns",
title: "Reorder Columns",
onClickButton : function (){
jQuery("#colch").jqGrid('columnChooser');
}
});
</XMP>
</div>
\ No newline at end of file
jQuery("#colch").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false, hidden:true}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pcolch',
sortname: 'invdate',
shrinkToFit :false,
viewrecords: true,
sortorder: "desc",
caption:"Column Chooser Example"
});
jQuery("#colch").jqGrid('navGrid','#pcolch',{add:false,edit:false,del:false,search:false,refresh:false});
jQuery("#colch").jqGrid('navButtonAdd','#pcolch',{
caption: "Columns",
title: "Reorder Columns",
onClickButton : function (){
jQuery("#colch").jqGrid('columnChooser');
}
jQuery("#colch").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false, hidden:true}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pcolch',
sortname: 'invdate',
shrinkToFit :false,
viewrecords: true,
sortorder: "desc",
caption:"Column Chooser Example"
});
jQuery("#colch").jqGrid('navGrid','#pcolch',{add:false,edit:false,del:false,search:false,refresh:false});
jQuery("#colch").jqGrid('navButtonAdd','#pcolch',{
caption: "Columns",
title: "Reorder Columns",
onClickButton : function (){
jQuery("#colch").jqGrid('columnChooser');
}
});
\ No newline at end of file
<div style="font-size:12px;">
Another great feature which is requested many times from the community - custom cretion of editable elements<br>
This is done with the following settings in colModel - edittype:'custom' and two functions - one to create the element and <br>
another to get the value from it<br>
In this exmple click on row to edit it and see what is happen when you perform saving in the column Client..
<br/>
<br />
<table id="cinput"></table>
<div id="pcinput"></div>
<script src="36custinput.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="cinput"></table>
<div id="pcinput"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
var lastsel;
function my_input(value, options) {
return $("<input type='text' size='10' value='"+value+"'/>");
}
function my_value(value) {
return "My value: "+value.val();
}
jQuery("#cinput").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{
name:'name',
index:'name',
width:100,
editable:true,
edittype:'custom',
editoptions:{
custom_element:my_input,
custom_value:my_value
}
},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
onSelectRow: function(id){
if(id && id!==lastsel){
jQuery('#cinput').jqGrid('restoreRow',lastsel);
jQuery('#cinput').jqGrid('editRow',id,true);
lastsel=id;
}
},
rowNum:10,
rowList:[10,20,30],
pager: '#pcinput',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Custom Input",
editurl: "server.php?q=dummy"
});
</XMP>
<div style="font-size:12px;">
Another great feature which is requested many times from the community - custom cretion of editable elements<br>
This is done with the following settings in colModel - edittype:'custom' and two functions - one to create the element and <br>
another to get the value from it<br>
In this exmple click on row to edit it and see what is happen when you perform saving in the column Client..
<br/>
<br />
<table id="cinput"></table>
<div id="pcinput"></div>
<script src="36custinput.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="cinput"></table>
<div id="pcinput"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
var lastsel;
function my_input(value, options) {
return $("<input type='text' size='10' value='"+value+"'/>");
}
function my_value(value) {
return "My value: "+value.val();
}
jQuery("#cinput").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{
name:'name',
index:'name',
width:100,
editable:true,
edittype:'custom',
editoptions:{
custom_element:my_input,
custom_value:my_value
}
},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
onSelectRow: function(id){
if(id && id!==lastsel){
jQuery('#cinput').jqGrid('restoreRow',lastsel);
jQuery('#cinput').jqGrid('editRow',id,true);
lastsel=id;
}
},
rowNum:10,
rowList:[10,20,30],
pager: '#pcinput',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Custom Input",
editurl: "server.php?q=dummy"
});
</XMP>
</div>
\ No newline at end of file
var lastsel;
function my_input(value, options) {
return $("<input type='text' size='10' value='"+value+"'/>");
}
function my_value(value) {
return "My value: "+value.val();
}
jQuery("#cinput").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{name:'name',index:'name asc, invdate', width:100,editable:true, edittype:'custom', editoptions:{custom_element:my_input,custom_value:my_value}},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
onSelectRow: function(id){
if(id && id!==lastsel){
jQuery('#cinput').jqGrid('restoreRow',lastsel);
jQuery('#cinput').jqGrid('editRow',id,true);
lastsel=id;
}
},
rowNum:10,
rowList:[10,20,30],
pager: '#pcinput',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Custom Input",
editurl: "server.php?q=dummy"
});
var lastsel;
function my_input(value, options) {
return $("<input type='text' size='10' value='"+value+"'/>");
}
function my_value(value) {
return "My value: "+value.val();
}
jQuery("#cinput").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{name:'name',index:'name asc, invdate', width:100,editable:true, edittype:'custom', editoptions:{custom_element:my_input,custom_value:my_value}},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
onSelectRow: function(id){
if(id && id!==lastsel){
jQuery('#cinput').jqGrid('restoreRow',lastsel);
jQuery('#cinput').jqGrid('editRow',id,true);
lastsel=id;
}
},
rowNum:10,
rowList:[10,20,30],
pager: '#pcinput',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Custom Input",
editurl: "server.php?q=dummy"
});
<div style="font-size:12px;">
Since it is not possible to meat every user requirement in the validation when we use editing<br>
we have created a possibility to create one defined from the developer<br>
This is done just with two options in colModel - custom:true (which initialize this) and custo_func which should perform validation<br>
In our example the amount value should have values between 200 and 300 when we perform editing and adding.
<br/>
<br />
<table id="custv"></table>
<div id="pcustv"></div>
<script src="36custvalid.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="custv"></table>
<div id="pcustv"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
function mycheck(value) {
if(parseFloat(value) >= 200 && parseFloat(value)<=300) {
return [true,"",""];
} else {
return [false,"The value should be between 200 and 300!",""];
}
}
jQuery("#custv").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{name:'name',index:'name asc, invdate', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true,editrules:{custom:true,custom_func:mycheck}},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcustv',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Custom Validation",
editurl: "server.php?q=dummy"
});
jQuery("#custv").jqGrid('navGrid','#pcustv',{del:false},{reloadAfterSubmit:false},{reloadAfterSubmit:false});
</XMP>
<div style="font-size:12px;">
Since it is not possible to meat every user requirement in the validation when we use editing<br>
we have created a possibility to create one defined from the developer<br>
This is done just with two options in colModel - custom:true (which initialize this) and custo_func which should perform validation<br>
In our example the amount value should have values between 200 and 300 when we perform editing and adding.
<br/>
<br />
<table id="custv"></table>
<div id="pcustv"></div>
<script src="36custvalid.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="custv"></table>
<div id="pcustv"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
function mycheck(value) {
if(parseFloat(value) >= 200 && parseFloat(value)<=300) {
return [true,"",""];
} else {
return [false,"The value should be between 200 and 300!",""];
}
}
jQuery("#custv").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{name:'name',index:'name asc, invdate', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true,editrules:{custom:true,custom_func:mycheck}},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcustv',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Custom Validation",
editurl: "server.php?q=dummy"
});
jQuery("#custv").jqGrid('navGrid','#pcustv',{del:false},{reloadAfterSubmit:false},{reloadAfterSubmit:false});
</XMP>
</div>
\ No newline at end of file
function mycheck(value, name) {
if(parseFloat(value) >= 200 && parseFloat(value)<=300) {
return [true,"",""];
} else {
return [false,name+": The value should be between 200 and 300!",""];
}
}
jQuery("#custv").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{name:'name',index:'name asc, invdate', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true,editrules:{custom:true,custom_func:mycheck}},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcustv',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Custom Validation",
editurl: "server.php?q=dummy"
});
jQuery("#custv").jqGrid('navGrid','#pcustv',{del:false},{reloadAfterSubmit:false},{reloadAfterSubmit:false});
function mycheck(value, name) {
if(parseFloat(value) >= 200 && parseFloat(value)<=300) {
return [true,"",""];
} else {
return [false,name+": The value should be between 200 and 300!",""];
}
}
jQuery("#custv").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{name:'name',index:'name asc, invdate', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true,editrules:{custom:true,custom_func:mycheck}},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcustv',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Custom Validation",
editurl: "server.php?q=dummy"
});
jQuery("#custv").jqGrid('navGrid','#pcustv',{del:false},{reloadAfterSubmit:false},{reloadAfterSubmit:false});
<div style="font-size:12px;">
Last, but not least we develop a row drag and drop method, which allow exchanging information between<br>
grids in visual maner.<br>
This feature uses the jQuery UI draggable and droppable widgets<br>
In this exmple try to drag rows between the grids following the allowed directions
<br>
<br />
<table>
<tbody>
<tr>
<td><table id="grid1"></table><div id="pgrid1"></div></td>
<td align="center"> &lt;===&gt;</td>
<td><table id="grid2"></table><div id="pgrid2"></div></td>
</tr>
<tr>
<td align= "center"> || </td>
<td align= "center">&nbsp;</td>
<td align= "center"> &nbsp; </td>
</tr>
<tr>
<td align= "center"> \/ </td>
<td align= "center">&nbsp;</td>
<td align= "center"> &nbsp; </td>
</tr>
<tr>
<td align= "center">
<table id="grid3"></table>
<div id="pgrid3"></div>
</td>
<td>&nbsp;</td>
<td> &nbsp; </td>
</tr>
</tbody>
</table>
<script src="36draganddrop.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b>Java Scrpt code</b>
<XMP>
jQuery("#grid1").jqGrid({
datatype: "local",
height: 100,
colNames: ['Id1', 'Name1', 'Values1'],
colModel: [{
name: 'id1',
index: 'id',
width: 100
}, {
name: 'name1',
index: 'name',
width: 100
}, {
name: 'values1',
index: 'values',
width: 200
}],
caption: 'Grid 1',
pager: '#pgrid1'
});
jQuery("#grid2").jqGrid({
datatype: "local",
height: 100,
colNames: ['Id2', 'Name2', 'Values2'],
colModel: [{
name: 'id2',
index: 'id',
width: 100
}, {
name: 'name2',
index: 'name',
width: 100
}, {
name: 'values2',
index: 'values',
width: 200
}],
caption: 'Grid 2',
pager: '#pgrid2'
});
jQuery("#grid3").jqGrid({
datatype: "local",
height: 'auto',
colNames: ['Id3', 'Name3', 'Values3'],
colModel: [{
name: 'id3',
index: 'id',
width: 100
}, {
name: 'name3',
index: 'name',
width: 100
}, {
name: 'values3',
index: 'values',
width: 200
}],
caption: 'Grid 3',
pager: '#pgrid3'
});
var mydata1 = [
{id1:"1",name1:"test1",values1:'One'},
{id1:"2",name1:"test2",values1:'Two'},
{id1:"3",name1:"test3",values1:'Three'}
];
var mydata2 = [
{id2:"11",name2:"test11",values2:'One1'},
{id2:"21",name2:"test21",values2:'Two1'},
{id2:"31",name2:"test31",values2:'Three1'}
];
var mydata3 = [
{id3:"12",name3:"test12",values3:'One2'},
{id3:"22",name3:"test22",values3:'Two2'},
{id3:"32",name3:"test32",values3:'Three2'}
];
for (var i = 0; i <= mydata1.length; i++) {
jQuery("#grid1").jqGrid('addRowData',i + 1, mydata1[i]);
jQuery("#grid2").jqGrid('addRowData',i + 1, mydata2[i]);
jQuery("#grid3").jqGrid('addRowData',i + 1, mydata3[i]);
}
jQuery("#grid1").jqGrid('gridDnD',{connectWith:'#grid2,#grid3'});
jQuery("#grid2").jqGrid('gridDnD',{connectWith:'#grid1'});
</XMP>
<div style="font-size:12px;">
Last, but not least we develop a row drag and drop method, which allow exchanging information between<br>
grids in visual maner.<br>
This feature uses the jQuery UI draggable and droppable widgets<br>
In this exmple try to drag rows between the grids following the allowed directions
<br>
<br />
<table>
<tbody>
<tr>
<td><table id="grid1"></table><div id="pgrid1"></div></td>
<td align="center"> &lt;===&gt;</td>
<td><table id="grid2"></table><div id="pgrid2"></div></td>
</tr>
<tr>
<td align= "center"> || </td>
<td align= "center">&nbsp;</td>
<td align= "center"> &nbsp; </td>
</tr>
<tr>
<td align= "center"> \/ </td>
<td align= "center">&nbsp;</td>
<td align= "center"> &nbsp; </td>
</tr>
<tr>
<td align= "center">
<table id="grid3"></table>
<div id="pgrid3"></div>
</td>
<td>&nbsp;</td>
<td> &nbsp; </td>
</tr>
</tbody>
</table>
<script src="36draganddrop.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b>Java Scrpt code</b>
<XMP>
jQuery("#grid1").jqGrid({
datatype: "local",
height: 100,
colNames: ['Id1', 'Name1', 'Values1'],
colModel: [{
name: 'id1',
index: 'id',
width: 100
}, {
name: 'name1',
index: 'name',
width: 100
}, {
name: 'values1',
index: 'values',
width: 200
}],
caption: 'Grid 1',
pager: '#pgrid1'
});
jQuery("#grid2").jqGrid({
datatype: "local",
height: 100,
colNames: ['Id2', 'Name2', 'Values2'],
colModel: [{
name: 'id2',
index: 'id',
width: 100
}, {
name: 'name2',
index: 'name',
width: 100
}, {
name: 'values2',
index: 'values',
width: 200
}],
caption: 'Grid 2',
pager: '#pgrid2'
});
jQuery("#grid3").jqGrid({
datatype: "local",
height: 'auto',
colNames: ['Id3', 'Name3', 'Values3'],
colModel: [{
name: 'id3',
index: 'id',
width: 100
}, {
name: 'name3',
index: 'name',
width: 100
}, {
name: 'values3',
index: 'values',
width: 200
}],
caption: 'Grid 3',
pager: '#pgrid3'
});
var mydata1 = [
{id1:"1",name1:"test1",values1:'One'},
{id1:"2",name1:"test2",values1:'Two'},
{id1:"3",name1:"test3",values1:'Three'}
];
var mydata2 = [
{id2:"11",name2:"test11",values2:'One1'},
{id2:"21",name2:"test21",values2:'Two1'},
{id2:"31",name2:"test31",values2:'Three1'}
];
var mydata3 = [
{id3:"12",name3:"test12",values3:'One2'},
{id3:"22",name3:"test22",values3:'Two2'},
{id3:"32",name3:"test32",values3:'Three2'}
];
for (var i = 0; i <= mydata1.length; i++) {
jQuery("#grid1").jqGrid('addRowData',i + 1, mydata1[i]);
jQuery("#grid2").jqGrid('addRowData',i + 1, mydata2[i]);
jQuery("#grid3").jqGrid('addRowData',i + 1, mydata3[i]);
}
jQuery("#grid1").jqGrid('gridDnD',{connectWith:'#grid2,#grid3'});
jQuery("#grid2").jqGrid('gridDnD',{connectWith:'#grid1'});
</XMP>
</div>
\ No newline at end of file
jQuery("#grid1").jqGrid({
datatype: "local",
height: 100,
colNames: ['Id1', 'Name1', 'Values1'],
colModel: [{
name: 'id1',
index: 'id',
width: 100
}, {
name: 'name1',
index: 'name',
width: 100
}, {
name: 'values1',
index: 'values',
width: 200
}],
caption: 'Grid 1',
pager: '#pgrid1'
});
jQuery("#grid2").jqGrid({
datatype: "local",
height: 100,
colNames: ['Id2', 'Name2', 'Values2'],
colModel: [{
name: 'id2',
index: 'id',
width: 100
}, {
name: 'name2',
index: 'name',
width: 100
}, {
name: 'values2',
index: 'values',
width: 200
}],
caption: 'Grid 2',
pager: '#pgrid2'
});
jQuery("#grid3").jqGrid({
datatype: "local",
height: 'auto',
colNames: ['Id3', 'Name3', 'Values3'],
colModel: [{
name: 'id3',
index: 'id',
width: 100
}, {
name: 'name3',
index: 'name',
width: 100
}, {
name: 'values3',
index: 'values',
width: 200
}],
caption: 'Grid 3',
pager: '#pgrid3'
});
var mydata1 = [
{id1:"1",name1:"test1",values1:'One'},
{id1:"2",name1:"test2",values1:'Two'},
{id1:"3",name1:"test3",values1:'Three'}
];
var mydata2 = [
{id2:"11",name2:"test11",values2:'One1'},
{id2:"21",name2:"test21",values2:'Two1'},
{id2:"31",name2:"test31",values2:'Three1'}
];
var mydata3 = [
{id3:"12",name3:"test12",values3:'One2'},
{id3:"22",name3:"test22",values3:'Two2'},
{id3:"32",name3:"test32",values3:'Three2'}
];
for (var i = 0; i <= mydata1.length; i++) {
jQuery("#grid1").jqGrid('addRowData',i + 1, mydata1[i]);
jQuery("#grid2").jqGrid('addRowData',i + 1, mydata2[i]);
jQuery("#grid3").jqGrid('addRowData',i + 1, mydata3[i]);
}
jQuery("#grid1").jqGrid('gridDnD',{connectWith:'#grid2,#grid3'});
jQuery("#grid2").jqGrid('gridDnD',{connectWith:'#grid1'});
jQuery("#grid1").jqGrid({
datatype: "local",
height: 100,
colNames: ['Id1', 'Name1', 'Values1'],
colModel: [{
name: 'id1',
index: 'id',
width: 100
}, {
name: 'name1',
index: 'name',
width: 100
}, {
name: 'values1',
index: 'values',
width: 200
}],
caption: 'Grid 1',
pager: '#pgrid1'
});
jQuery("#grid2").jqGrid({
datatype: "local",
height: 100,
colNames: ['Id2', 'Name2', 'Values2'],
colModel: [{
name: 'id2',
index: 'id',
width: 100
}, {
name: 'name2',
index: 'name',
width: 100
}, {
name: 'values2',
index: 'values',
width: 200
}],
caption: 'Grid 2',
pager: '#pgrid2'
});
jQuery("#grid3").jqGrid({
datatype: "local",
height: 'auto',
colNames: ['Id3', 'Name3', 'Values3'],
colModel: [{
name: 'id3',
index: 'id',
width: 100
}, {
name: 'name3',
index: 'name',
width: 100
}, {
name: 'values3',
index: 'values',
width: 200
}],
caption: 'Grid 3',
pager: '#pgrid3'
});
var mydata1 = [
{id1:"1",name1:"test1",values1:'One'},
{id1:"2",name1:"test2",values1:'Two'},
{id1:"3",name1:"test3",values1:'Three'}
];
var mydata2 = [
{id2:"11",name2:"test11",values2:'One1'},
{id2:"21",name2:"test21",values2:'Two1'},
{id2:"31",name2:"test31",values2:'Three1'}
];
var mydata3 = [
{id3:"12",name3:"test12",values3:'One2'},
{id3:"22",name3:"test22",values3:'Two2'},
{id3:"32",name3:"test32",values3:'Three2'}
];
for (var i = 0; i <= mydata1.length; i++) {
jQuery("#grid1").jqGrid('addRowData',i + 1, mydata1[i]);
jQuery("#grid2").jqGrid('addRowData',i + 1, mydata2[i]);
jQuery("#grid3").jqGrid('addRowData',i + 1, mydata3[i]);
}
jQuery("#grid1").jqGrid('gridDnD',{connectWith:'#grid2,#grid3'});
jQuery("#grid2").jqGrid('gridDnD',{connectWith:'#grid1'});
<div style="font-size:12px;">
From 3.6 we introduce new API, which is similar to jQuery UI. Using the new API saves a namespace<br>
conflicts with other plugins and make using jqGrid more natural in the code, showing that this is connected
with jqGrid methods.<br>
The calling convension is <br>
<p><b>(jqgridelement).jqGrid( method ,parameter1,...,parameterN);</b></p>
Where method is exiting jqGrid method<br/>
In the example above we do: <br/>
<div style="color:blue">
<code>
jQuery("#newapi").jqGrid('navGrid','#pnewapi',{edit:false,add:false,del:false});
</code>
</div>
<p style="width:750px;">
To enjoy full of this API a new variable is used in $.jgrid namespace - called $.jgrid.no_legacy_api,
which default value is false. The variable should be set before including jqGrid Java Script file or
can be added in the language file.
</p>
<br />
<table id="newapi"></table>
<div id="pnewapi"></div>
<script src="36newapi.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="newapi"></table>
<div id="pnewapi"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#newapi").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pnewapi',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
</XMP>
<div style="color:blue">
<code>
jQuery("#newapi").jqGrid('navGrid','#pnewapi',{edit:false,add:false,del:false});
</code>
</div>
<div style="font-size:12px;">
From 3.6 we introduce new API, which is similar to jQuery UI. Using the new API saves a namespace<br>
conflicts with other plugins and make using jqGrid more natural in the code, showing that this is connected
with jqGrid methods.<br>
The calling convension is <br>
<p><b>(jqgridelement).jqGrid( method ,parameter1,...,parameterN);</b></p>
Where method is exiting jqGrid method<br/>
In the example above we do: <br/>
<div style="color:blue">
<code>
jQuery("#newapi").jqGrid('navGrid','#pnewapi',{edit:false,add:false,del:false});
</code>
</div>
<p style="width:750px;">
To enjoy full of this API a new variable is used in $.jgrid namespace - called $.jgrid.no_legacy_api,
which default value is false. The variable should be set before including jqGrid Java Script file or
can be added in the language file.
</p>
<br />
<table id="newapi"></table>
<div id="pnewapi"></div>
<script src="36newapi.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="newapi"></table>
<div id="pnewapi"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#newapi").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pnewapi',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
</XMP>
<div style="color:blue">
<code>
jQuery("#newapi").jqGrid('navGrid','#pnewapi',{edit:false,add:false,del:false});
</code>
</div>
</div>
\ No newline at end of file
jQuery("#newapi").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pnewapi',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#newapi").jqGrid('navGrid','#pnewapi',{edit:false,add:false,del:false});
jQuery("#newapi").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pnewapi',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#newapi").jqGrid('navGrid','#pnewapi',{edit:false,add:false,del:false});
<div style="font-size:12px;">
This is experimental method which resizes the grid<br>
This feature uses the jQuery UI resizable widget<br>
<br>
<table id="resize"></table>
<div id="presize"></div>
<script src="36resize.js" type="text/javascript"> </script>
<br />
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="newapi"></table>
<div id="pnewapi"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#resize").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#presize',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#resize").jqGrid('navGrid','#presize',{edit:false,add:false,del:false});
jQuery("#resize").jqGrid('gridResize',{minWidth:350,maxWidth:800,minHeight:80, maxHeight:350});</XMP>
<div style="font-size:12px;">
This is experimental method which resizes the grid<br>
This feature uses the jQuery UI resizable widget<br>
<br>
<table id="resize"></table>
<div id="presize"></div>
<script src="36resize.js" type="text/javascript"> </script>
<br />
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="newapi"></table>
<div id="pnewapi"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#resize").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#presize',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#resize").jqGrid('navGrid','#presize',{edit:false,add:false,del:false});
jQuery("#resize").jqGrid('gridResize',{minWidth:350,maxWidth:800,minHeight:80, maxHeight:350});</XMP>
</div>
\ No newline at end of file
jQuery("#resize").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#presize',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#resize").jqGrid('navGrid','#presize',{edit:false,add:false,del:false});
jQuery("#resize").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#presize',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#resize").jqGrid('navGrid','#presize',{edit:false,add:false,del:false});
jQuery("#resize").jqGrid('gridResize',{minWidth:350,maxWidth:800,minHeight:100, maxHeight:350});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment