Changed big job table
This commit is contained in:
parent
267ca75cf5
commit
101e045ac1
|
|
@ -25,7 +25,7 @@ class JobsController extends AppController {
|
||||||
|
|
||||||
function index_grid() {
|
function index_grid() {
|
||||||
|
|
||||||
|
$this->layout = 'grid';
|
||||||
$jobs = $this->paginate();
|
$jobs = $this->paginate();
|
||||||
|
|
||||||
$this->set('jobs', $jobs);
|
$this->set('jobs', $jobs);
|
||||||
|
|
|
||||||
|
|
@ -137,11 +137,20 @@ echo $javascript->link('addjob');
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?php echo $job['Job']['gst']; ?>
|
<?php if($job['Job']['gst'] == 1) {
|
||||||
|
echo "GST Applicable";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?php echo $job['Job']['currency_id']; ?>
|
<?php echo $currencies[$job['Job']['currency_id']]; ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
|
|
||||||
|
|
@ -1265,3 +1265,10 @@ span.addLineItem {
|
||||||
.viewLink {
|
.viewLink {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#grid {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
|
@ -1,51 +1,110 @@
|
||||||
/* jobindex.js
|
function requiredFieldValidator(value) {
|
||||||
*
|
if (value == null || value == undefined || !value.length)
|
||||||
* Implement Edit in Place
|
return {
|
||||||
*
|
valid:false,
|
||||||
*/
|
msg:"This is a required field"
|
||||||
|
};
|
||||||
|
else
|
||||||
$(function() {
|
return {
|
||||||
|
valid:true,
|
||||||
|
msg:null
|
||||||
|
};
|
||||||
});
|
|
||||||
|
|
||||||
function doGet(link) {
|
|
||||||
|
|
||||||
$.get("/jobs/edit/"+link, function(data){
|
|
||||||
$("#editDiv").html(data);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var grid;
|
||||||
|
var data = [];
|
||||||
|
var columns = [
|
||||||
|
{
|
||||||
|
id:"title",
|
||||||
|
name:"Title",
|
||||||
|
field:"title",
|
||||||
|
width:120,
|
||||||
|
cssClass:"cell-title",
|
||||||
|
editor:TextCellEditor,
|
||||||
|
validator:requiredFieldValidator
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:"desc",
|
||||||
|
name:"Description",
|
||||||
|
field:"description",
|
||||||
|
width:100,
|
||||||
|
editor:LongTextCellEditor
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:"duration",
|
||||||
|
name:"Duration",
|
||||||
|
field:"duration",
|
||||||
|
editor:TextCellEditor
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:"%",
|
||||||
|
name:"% Complete",
|
||||||
|
field:"percentComplete",
|
||||||
|
width:80,
|
||||||
|
resizable:false,
|
||||||
|
formatter:GraphicalPercentCompleteCellFormatter,
|
||||||
|
editor:PercentCompleteCellEditor
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:"start",
|
||||||
|
name:"Start",
|
||||||
|
field:"start",
|
||||||
|
minWidth:60,
|
||||||
|
editor:DateCellEditor
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:"finish",
|
||||||
|
name:"Finish",
|
||||||
|
field:"finish",
|
||||||
|
minWidth:60,
|
||||||
|
editor:DateCellEditor
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:"effort-driven",
|
||||||
|
name:"Effort Driven",
|
||||||
|
width:80,
|
||||||
|
minWidth:20,
|
||||||
|
maxWidth:80,
|
||||||
|
cssClass:"cell-effort-driven",
|
||||||
|
field:"effortDriven",
|
||||||
|
formatter:BoolCellFormatter,
|
||||||
|
editor:YesNoCheckboxCellEditor
|
||||||
|
}
|
||||||
|
];
|
||||||
|
var options = {
|
||||||
|
editable: true,
|
||||||
|
enableAddRow: true,
|
||||||
|
enableCellNavigation: true,
|
||||||
|
asyncEditorLoading: false,
|
||||||
|
autoEdit: false
|
||||||
|
};
|
||||||
|
|
||||||
|
$(function()
|
||||||
|
{
|
||||||
|
for (var i=0; i<500; i++) {
|
||||||
|
var d = (data[i] = {});
|
||||||
|
|
||||||
function getParent(object) {
|
d["title"] = "Task " + i;
|
||||||
return object.parent('tr').attr('id')
|
d["description"] = "This is a sample task description.\n It can be multiline";
|
||||||
|
d["duration"] = "5 days";
|
||||||
|
d["percentComplete"] = Math.round(Math.random() * 100);
|
||||||
|
d["start"] = "01/01/2009";
|
||||||
|
d["finish"] = "01/05/2009";
|
||||||
|
d["effortDriven"] = (i % 5 == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
grid = new Slick.Grid("#myGrid", data, columns, options);
|
||||||
*
|
|
||||||
* $(".editWindow").click(function() {
|
|
||||||
|
|
||||||
|
//grid.registerPlugin(new Slick.CellRangeSelector());
|
||||||
|
|
||||||
//$(this).attr("name");
|
grid.setSelectionModel(new Slick.CellSelectionModel());
|
||||||
|
|
||||||
doGet($(this).attr("name"));
|
grid.onAddNewRow.subscribe(function(e, args) {
|
||||||
$("#editDiv").dialog('open');
|
var item = args.item;
|
||||||
|
var column = args.column;
|
||||||
return false;
|
grid.invalidateRow(data.length);
|
||||||
|
data.push(item);
|
||||||
|
grid.updateRowCount();
|
||||||
|
grid.render();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#editDiv").hide();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#editDiv").dialog({
|
|
||||||
autoOpen: false,
|
|
||||||
width: 900,
|
|
||||||
modal: true
|
|
||||||
|
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
Loading…
Reference in a new issue