Skip to content
This repository
tree: 1d7bd1d404
Fetching contributors…

Cannot retrieve contributors at this time

file 84 lines (75 sloc) 2.277 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>grid</title>
        <style type='text/css'>
            body {font-family: verdana}
            .error {border: solid 1px red;}
            .error_text { color: red; font-size: 10px;}
            td {padding: 3px;}

body {
padding: 0px;
margin: 0px;
}
        </style>
<link type="text/css" href="grid/grid.css" rel="stylesheet" />
</head>
<body>
<div class='grid'>

</div>
<script type='text/javascript'
                src='../steal/steal.js'>
        </script>
<script type='text/javascript'>
steal("mxui/grid",
"mxui/filler",
"jquery/model",
"jquery/dom/fixture").then(function($){
$.fixture["make"](["resources","resource"],100,function(num){
return {
id : num,
name : "Resource "+num,
description: "Resource "+num+" description. You might want to read this.",
date: new Date(Math.random()*1000*60*60*24*365*30),
location: Math.round(Math.random()*2000)+" Pinetree Ln",
users_count: Math.round(Math.random()*20),
active_days: Math.round(Math.random()*20),
other_things : "Blah blah blah"
}
})


$.Model.extend("Resource",{
findAll : function(params, success, error){
$.ajax({
url: '/resource',
type: 'get',
dataType: 'json',
data: params,
success: this.callback(['wrapMany',success]),
error: error,
fixture: "-resources" //calculates the fixture path from the url and type.
})
},
findOne : function(params, success, error){
$.ajax({
url: '/resources',
type: 'get',
dataType: 'json',
data: params,
success: this.callback(['wrap',success]),
error: error,
fixture: "-resource" //calculates the fixture path from the url and type.
})
}
},{})


$(".grid").mxui_filler().mxui_grid({
model: Resource,
limit: 100,
offset: 0,
render : {
}
})


})

</script>
</body>
</html>
Something went wrong with that request. Please try again.