Commit beeadcad authored by robot's avatar robot
Browse files

project: preparation for starting development qfq-jqw

parent cb8f2f85
bootstrap:
npm install
bower install
grunt default
<?php
/**
* Created by PhpStorm.
* User: ep
* Date: 12/23/15
* Time: 6:17 PM
*/
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: ep
* Date: 12/23/15
* Time: 6:16 PM
*/
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="packages/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="packages/bootstrap/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="packages/jqwidgets/css/jqx.base.css">
<link rel="stylesheet" href="packages/jqwidgets/css/jqx.darkblue.css">
<script src="packages/jquery/js/jquery.min.js"></script>
<script src="packages/bootstrap/js/bootstrap.min.js"></script>
<script src="packages/jqwidgets/js/jqx-all.js"></script>
<title>QFQ DevWrapper</title>
<style>
/*inline elements in horizontal mode are too much left*/
.form-horizontal .form-inline .form-group {
margin: 0;
}
.form-inline .control-label {
font-weight: normal;
}
</style>
</head>
<body>
<?php
include("t3/form.php");
loadForm();
?>
</body>
</html>
\ No newline at end of file
1. The SDK files are located in the jqwidgets directory
In general you need to use files from this directory only.
Files list & description:
Files required in all projects using the SDK:
jqxcore.js: Core jQWidgets framework
Stylesheet files. Include at least one stylesheet Theme file and the images folder:
styles/jqx.base.css: Stylesheet for the base Theme. The jqx.base.css file should be always included in your project.
styles/jqx.android.css: Stylesheet for the Android Theme
styles/jqx.arctic.css: Stylesheet for the Arctic Theme
styles/jqx.web.css: Stylesheet for the Web Theme
styles/jqx.black.css: Stylesheet for the Black Theme
styles/jqx.blackberry.css: Stylesheet for the Blackberry Theme
styles/jqx.bootstrap.css: Stylesheet for the Bootstrap Theme
styles/jqx.classic.css: Stylesheet for the Classic Theme
styles/jqx.darkblue.css: Stylesheet for the DarkBlue Theme
styles/jqx.energyblue.css: Stylesheet for the EnergyBlue Theme
styles/jqx.fresh.css: Stylesheet for the Fresh Theme
styles/jqx.highcontrast.css: Stylesheet for the High Contrast Theme
styles/jqx.metro.css: Stylesheet for the Metro Theme
styles/jqx.metrodark.css: Stylesheet for the Metro Dark Theme
styles/jqx.mobile.css: Stylesheet for the Mobile Theme
styles/jqx.office.css: Stylesheet for the Office Theme
styles/jqx.orange.css: Stylesheet for the Orange Theme
styles/jqx.shinyblack.css: Stylesheet for the ShinyBlack Theme
styles/jqx.summer.css: Stylesheet for the Summer Theme
styles/jqx.windowsphone.css: Stylesheet for the Windows Phone Theme
styles/jqx.ui-darkness.css: Stylesheet for the UI Darkness Theme
styles/jqx.ui-lightness.css: Stylesheet for the UI Lightness Theme
styles/jqx.ui-le-frog.css: Stylesheet for the UI Le Frog Theme
styles/jqx.ui-overcast.css: Stylesheet for the UI Overcast Theme
styles/jqx.ui-redmond.css: Stylesheet for the UI Redmond Theme
styles/jqx.ui-smoothness.css: Stylesheet for the UI Smoothness Theme
styles/jqx.ui-start.css: Stylesheet for the UI Start Theme
styles/jqx.ui-sunny.css: Stylesheet for the UI Sunny Theme
styles/images: contains images referenced in the stylesheet files
Files for individual widgets and plug-ins. Include depending on project needs:
jqxangular.js: AngularJS integration plug-in
jqxbuttons.js: Button, RepeatButton, SubmitButton & ToggleButton widgets
jqxbulletchart.js: BulletChart widget
jqxbuttongroup.js: Button group widget
jqxcalendar.js: Calendar widget
jqxcombobox.js: ComboBox widget
jqxcomplexinput.js: Complex Numbers TextBox widget
jqxchart.core.js: Chart widget's Core
jqxchart.rangeselector.js: Chart Range Selector
jqxchart.api.js: Chart API
jqxchart.annotations.js: Chart's annotations
jqxchart.waterfall.js: Waterfall Chart
jqxcheckbox.js: CheckBox widget
jqxdate.js: DateTime plug-in
jqxdata.js: Data Source plug-in
jqxdata.export.js: Data Export plug-in
jqxdatetimeinput.js: DateTimeInput widget
jqxcolorpicker.js: Color Picker widget
jqxdatatable.js: DataTable widget
jqxdocking.js: Docking widget
jqxdropdownbutton.js: DropDown Button widget
jqxdragdrop.js: DragDrop plug-in
jqxdraw.js: Draw Plugin.
jqxdockpanel.js: DockPanel widget
jqxdockinglayout.js: Docking Layout widget
jqxdropdownlist.js: DropDownList widget
jqxeditor.js: Editor widget
jqxexpander.js: Expander widget
jqxfileupload.js: FileUpload widget
jqxformattedinput.js: Binary, Octal, Hex TextBox widget
jqxgrid.js: Grid widget
jqxgrid.sort.js: Grid Sort plug-in
jqxgrid.filter.js: Grid Filter plug-in
jqxgrid.grouping.js: Grid Grouping plug-in
jqxgrid.selection.js: Grid Selection plug-in
jqxgrid.columnsresize.js: Grid Columns Resize plug-in
jqxgrid.columnsreorder.js: Grid Columns Reorder plug-in
jqxgrid.pager.js: Grid Pager plug-in
jqxgrid.edit.js: Grid Editing plug-in
jqxgrid.storage.js: Grid Save/Load state plug-in
jqxgrid.aggregates.js: Grid Aggregates plug-in
jqxgauge.js: Radial and Linear Gauge widget
jqxinput.js: TextBox widget
jqxknockout.js: Knockout integration plug-in
jqxlayout.js: Layout widget
jqxlistbox.js: ListBox widget
jqxloader.js: Loader widget
jqxmaskedinput.js: Masked TextBox widget
jqxmenu.js: Menu widget
jqxnavigationbar.js: NavigationBar widget
jqxnavbar.js: NavBar widget
jqxnotification.js: Notification widget
jqxnumberinput.js: NumberInput TextBox widget
jqxpanel.js: Panel widget
jqxpopover.js: Popover widget
jqxprogressbar.js: ProgressBar widget
jqxpasswordinput.js: Password input widget
jqxrating.js: Rating widget
jqxradiobutton.js: RadioButton widget
jqxrangeselector.js: RangeSelector widget
jqxresponse.js: Response plug-in
jqxribbon.js: Ribbon widget
jqxresponsivepanel.js: Responsive Panel widget
jqxswitchbutton.js: Switch Button widget
jqxscrollbar.js: ScrollBar widget
jqxscrollview.js: ScrollView widget
jqxsplitter.js: Splitter widget
jqxslider.js: Slider widget
jqxscheduler.js: Scheduler widget
jqxscheduler.api.js: Scheduler API plugin
jqxtabs.js: Tabs widget
jqxtree.js: Tree widget
jqxtagcloud.js: Tagcloud widget
jqxtreemap.js: TreeMap widget
jqxtreegrid.js: TreeGrid widget
jqxtoolbar.js: Toolbar widget
jqxtooltip.js: ToolTip widget
jqxvalidator.js: Validation plug-in
jqxwindow.js: Window widget
File for all widgets and plug-ins:
jqx-all.js
2.Examples
The index.htm file starts the demo/examples browser
Individual widget examples are located in the /demos directory
The mobile examples are located in the /mobiledemos directory
The php & mysql integration demos are located in the /phpdemos and demos/php directories.
All php integration samples use and require the Northwind Database(/phpdemos/Northwind.MySQL5.sql).
Any examples that use Ajax need to be on a Web Server in order to work correctly.
3.Documentation
Browse the documentation and examples through the index.htm file
Individual documentation files are located in the /documentation directory
4.Other files
The /scripts, /images, /styles folders contain the jquery library and
other files used by the demo only.
5.License & Purchase
For more information regarding the licensing, please visit: http://www.jqwidgets.com/license
This diff is collapsed.
Important:
To run a sample that includes data binding, you must open it via "http://..." protocol since Ajax makes http requests.
Please, run any sample on a Localhost or Web Server.
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using System.Globalization;
using jQWidgetsMVCDemo.Models;
namespace jQWidgetsMVCDemo.Controllers
{
public class EmployeeController : Controller
{
private EmployeesDBEntities db = new EmployeesDBEntities();
public JsonResult GetEmployees()
{
var dbResult = db.Employees.ToList();
var employees = (from employee in dbResult
select new
{
employee.FirstName,
employee.LastName,
employee.EmployeeID,
employee.BirthDate,
employee.HireDate,
employee.ManagerID,
employee.Title,
employee.City,
employee.Country,
employee.Address
});
return Json(employees, JsonRequestBehavior.AllowGet);
}
// GET: /Employee/
public ActionResult Index()
{
return View(db.Employees.ToList());
}
private string BuildQuery(System.Collections.Specialized.NameValueCollection query)
{
var result = query.GetValues("filterslength");
if (result == null)
return @"SELECT * FROM Employee";
var filtersCount = int.Parse(query.GetValues("filterslength")[0]);
var queryString = @"SELECT * FROM Employee ";
var tmpDataField = "";
var tmpFilterOperator = "";
var where = "";
if (filtersCount > 0)
{
where = " WHERE (";
}
for (var i = 0; i < filtersCount; i += 1)
{
var filterValue = query.GetValues("filtervalue" + i)[0];
var filterCondition = query.GetValues("filtercondition" + i)[0];
var filterDataField = query.GetValues("filterdatafield" + i)[0];
var filterOperator = query.GetValues("filteroperator" + i)[0];
if (tmpDataField == "")
{
tmpDataField = filterDataField;
}
else if (tmpDataField != filterDataField)
{
where += ") AND (";
}
else if (tmpDataField == filterDataField)
{
if (tmpFilterOperator == "")
{
where += " AND ";
}
else
{
where += " OR ";
}
}
// build the "WHERE" clause depending on the filter's condition, value and datafield.
where += this.GetFilterCondition(filterCondition, filterDataField, filterValue);
if (i == filtersCount - 1)
{
where += ")";
}
tmpFilterOperator = filterOperator;
tmpDataField = filterDataField;
}
queryString += where;
return queryString;
}
private string GetFilterCondition(string filterCondition, string filterDataField, string filterValue)
{
switch (filterCondition)
{
case "NOT_EMPTY":
case "NOT_NULL":
return " " + filterDataField + " NOT LIKE '" + "" + "'";
case "EMPTY":
case "NULL":
return " " + filterDataField + " LIKE '" + "" + "'";
case "CONTAINS_CASE_SENSITIVE":
return " " + filterDataField + " LIKE '%" + filterValue + "%'" + " COLLATE SQL_Latin1_General_CP1_CS_AS";
case "CONTAINS":
return " " + filterDataField + " LIKE '%" + filterValue + "%'";
case "DOES_NOT_CONTAIN_CASE_SENSITIVE":
return " " + filterDataField + " NOT LIKE '%" + filterValue + "%'" + " COLLATE SQL_Latin1_General_CP1_CS_AS"; ;
case "DOES_NOT_CONTAIN":
return " " + filterDataField + " NOT LIKE '%" + filterValue + "%'";
case "EQUAL_CASE_SENSITIVE":
return " " + filterDataField + " = '" + filterValue + "'" + " COLLATE SQL_Latin1_General_CP1_CS_AS"; ;
case "EQUAL":
return " " + filterDataField + " = '" + filterValue + "'";
case "NOT_EQUAL_CASE_SENSITIVE":
return " BINARY " + filterDataField + " <> '" + filterValue + "'";
case "NOT_EQUAL":
return " " + filterDataField + " <> '" + filterValue + "'";
case "GREATER_THAN":
return " " + filterDataField + " > '" + filterValue + "'";
case "LESS_THAN":
return " " + filterDataField + " < '" + filterValue + "'";
case "GREATER_THAN_OR_EQUAL":
return " " + filterDataField + " >= '" + filterValue + "'";
case "LESS_THAN_OR_EQUAL":
return " " + filterDataField + " <= '" + filterValue + "'";
case "STARTS_WITH_CASE_SENSITIVE":
return " " + filterDataField + " LIKE '" + filterValue + "%'" + " COLLATE SQL_Latin1_General_CP1_CS_AS"; ;
case "STARTS_WITH":
return " " + filterDataField + " LIKE '" + filterValue + "%'";
case "ENDS_WITH_CASE_SENSITIVE":
return " " + filterDataField + " LIKE '%" + filterValue + "'" + " COLLATE SQL_Latin1_General_CP1_CS_AS"; ;
case "ENDS_WITH":
return " " + filterDataField + " LIKE '%" + filterValue + "'";
}
return "";
}
public JsonResult GetCurrentEmployees(string sortdatafield, string sortorder, int pagesize, int pagenum)
{
var query = Request.QueryString;
var dbResult = db.Database.SqlQuery<Employee>(this.BuildQuery(query));
var employees = (from employee in dbResult
select new
{
employee.FirstName,
employee.LastName,
employee.EmployeeID,
employee.BirthDate,
employee.HireDate,
employee.ManagerID,
employee.Title,
employee.City,
employee.Country,
employee.Address
});
var total = dbResult.Count();
if (sortorder != null && sortorder != "")
{
if (sortorder == "asc")
{
employees = employees.OrderBy(o => o.GetType().GetProperty(sortdatafield).GetValue(o, null));
}
else
{
employees = employees.OrderByDescending(o => o.GetType().GetProperty(sortdatafield).GetValue(o, null));
}
}
employees = employees.Skip(pagesize * pagenum).Take(pagesize);
var result = new
{
TotalRows = total,
Rows = employees
};
return Json(result, JsonRequestBehavior.AllowGet);
}
// GET: /Employee/Details/5
public ActionResult Details(int? employeeId)
{
if (employeeId == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
Employee employee = db.Employees.Find(employeeId);
if (employee == null)
{
return HttpNotFound();
}
return View(employee);
}
[HttpPost]
public ActionResult Register()
{
DateTime maxDate = new DateTime(2015, 1, 1);
if (Request.Form["birthDateValidate"] != null)
{
var birthDateValidate = DateTime.Parse(Request.Form["birthDateValidate"], CultureInfo.CurrentCulture);
if (birthDateValidate > maxDate)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
else
{
return new HttpStatusCodeResult(HttpStatusCode.Accepted);
}
}
if (Request.Form["birthDate"] != null)
{
var birthDate = DateTime.Parse(Request.Form["birthDate"], CultureInfo.CurrentCulture);
if (birthDate > maxDate)
{
return RedirectToAction("RegisterFailed");
}
}
var terms = Request.Form["acceptTerms"];
if (terms != null)
{
if (terms == "false")
{
return RedirectToAction("RegisterFailed");
}
}
Employee employee = new Employee();
employee.FirstName = Request.Form["FirstName"];
employee.LastName = Request.Form["LastName"];
employee.Title = Request.Form["Title"];
if (Request.Form["birthDate"] != null)
{
employee.BirthDate = DateTime.Parse(Request.Form["birthDate"]);
}
else employee.BirthDate = new DateTime(1900, 1, 1);
return View(employee);
}
public ActionResult RegisterFailed()
{
return View();
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
db.Dispose();
}
base.Dispose(disposing);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace jQWidgetsMVCDemo.Controllers
{
public class WidgetsController : Controller
{
//
// GET: /Widgets/
public ActionResult Index()
{
return View("Grid");
}
// GET: /Widgets//Grid
public ActionResult Grid(string theme)
{
ViewData["Theme"] = theme;
return View("Grid");
}
// GET: /Widgets//TreeGrid
public ActionResult TreeGrid(string theme)
{
ViewData["Theme"] = theme;
return View("TreeGrid");
}
// GET: /Widgets//ListBox
public ActionResult ListBox(string theme)
{
ViewData["Theme"] = theme;
return View("ListBox");
}
// GET: /Widgets//ComboBox
public ActionResult ComboBox(string theme)
{
ViewData["Theme"] = theme;
return View("ComboBox");
}
// GET: /Widgets//DataTable
public ActionResult DataTable(string theme)
{
ViewData["Theme"] = theme;
return View("DataTable");
}
// GET: /Widgets//Chart
public ActionResult Chart(string theme)
{
return View("Chart");
}
// GET: /Widgets//DropDownList
public ActionResult DropDownList(string theme)
{
ViewData["Theme"] = theme;
return View("DropDownList");
}
// GET: /Widgets//TreeWithCheckboxes
public ActionResult TreeWithCheckboxes(string theme)
{
ViewData["Theme"] = theme;
return View("TreeWithCheckboxes");
}
// GET: /Widgets//Tree
public ActionResult Tree()
{
var items = Request.Form["tree"];
if (null == items)
items = "";
ViewData["Tree Items"] = items;
return View();
}
// GET: /Widgets//Store
public ActionResult Store()
{
var shirt = Request.Form["shirt"];
if (shirt != null)
{
string price = "0.00";
switch (shirt)
{
case "Brown":
price = "5.00";
break;
case "Red":
price = "6.00";
break;
case "Green":
price = "7.75";
break;
case "Black":
price = "8.25";
break;
case "White":
price = "9.50";
break;
}
return Json(price, JsonRequestBehavior.AllowGet);
}
ViewData["Color"] = Request.Form["shirtDropdownList"];
ViewData["Size"] = Request.Form["shirtDropDownListSize"];
ViewData["Price"] = Request.Form["priceInput"];
return View();
}
// /Widgets/LoginFailed