Commit c4bfd01f authored by Carsten  Rose's avatar Carsten Rose
Browse files

Initial commit

parents
/node_modules
/packages
/bower_components
# Created by .ignore support plugin (hsz.mobi)
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
bootstrap: {
files: [
{
src: [
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/bootstrap/dist/css/bootstrap-theme.min.css'
],
dest: 'packages/bootstrap/css/',
filter: 'isFile',
flatten: true
},
{
src: [
'bower_components/bootstrap/dist/js/bootstrap.min.js'
],
dest: 'packages/bootstrap/js/',
flatten: true
},
{
expand: true,
src: [
'bower_components/bootstrap/dist/fonts/*'
],
dest: 'packages/bootstrap/fonts/',
flatten: true
}
]
},
jquery: {
files: [
{
src: [
'bower_components/jquery/dist/jquery.min.js'
],
dest: 'packages/jquery/js/',
flatten: true
}
]
},
jqwidgets: {
files: [
{
src: [
'bower_components/jqwidgets/jqwidgets/jqx-all.js'
],
dest: 'packages/jqwidgets/js/',
flatten: true
},
{
src: [
'bower_components/jqwidgets/jqwidgets/styles/jqx.base.css',
'bower_components/jqwidgets/jqwidgets/styles/jqx.darkblue.css'
],
dest: 'packages/jqwidgets/css/',
flatten: true
}
]
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task(s).
grunt.registerTask('default', ['copy']);
};
\ No newline at end of file
===============
Doc: https://wikiit.math.uzh.ch/it/projekt/qfq/qfq-jqwidgets
\ No newline at end of file
{
"name": "qfq",
"authors": [
"Carsten Rose <carsten.rose@math.uzh.ch>"
],
"description": "",
"main": "",
"moduleType": [],
"license": "MIT",
"homepage": "",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"bootstrap": "~3.3.6",
"jqwidgets": "*"
}
}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Getting Started</title>
<!-- add one of the jQWidgets styles -->
<link rel="stylesheet"
href="jqwidgets/jqwidgets/styles/jqx.base.css" type="text/css" />
<link rel="stylesheet"
href="jqwidgets/jqwidgets/styles/jqx.darkblue.css" type="text/css" />
<!-- add the jQuery script -->
<script type="text/javascript" src="jqwidgets/scripts/jquery-1.11.1.min.js"></script>
<!-- add the jQWidgets framework -->
<script type="text/javascript" src="jqwidgets/jqwidgets/jqx-all.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function () {
$("#myButton").jqxButton(
{ width: '120px', height: '35px', theme: 'darkblue' }
);
});
</script>
<input type="button" value="Click Me" id='myButton' />
<div id='content'>
<script type="text/javascript">
$(document).ready(function () {
var source = [
"Affogato",
"Americano",
"Bicerin",
"Breve",
"Café Bombón",
"Café au lait",
"Caffé Corretto",
"Café Crema",
"Caffé Latte",
"Caffé macchiato",
"Café mélange",
"Coffee milk",
"Cafe mocha",
"Cappuccino",
"Carajillo",
"Cortado",
"Cuban espresso",
"Espresso",
"Eiskaffee",
"The Flat White",
"Frappuccino",
"Galao",
"Greek frappé coffee",
"Iced Coffee",
"Indian filter coffee",
"Instant coffee",
"Irish coffee",
"Liqueur coffee"
];
// Create a jqxDropDownList
$("#jqxWidget").jqxDropDownList({ source: source, selectedIndex: 1});
$("input[name=fruit]").click(function(evt) {
var data = [
"Affogato",
"Americano",
"Bicerin",
"Affogato",
"Americano",
"Bicerin"
];
$("#jqxWidget").jqxDropDownList({source: data, selectedIndex: 3});
});
var data = [{ "empName": "test", "age": "67", "department": { "id": "1234", "name": "Sales" }, "author": "ravi"},
{"empName": "test2"}
];
// prepare the data
var source =
{
datatype: "json",
datafields: [
{ name: 'empName' }
],
localdata: data
};
var dataAdapter = new $.jqx.dataAdapter(source);
$("#inputAdapter").jqxDropDownList({source: dataAdapter, placeHolder: "Enter text here", displayMember: "empName"});
});
</script>
<div id='jqxWidget'>
</div>
<div id="inputAdapter">
</div>
<div>
<input type="radio" name="fruit" value="apple"> Apple
<br>
<input type="radio" name="fruit" value="prune"> Prune
</div>
</div>
</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)
{