Use the actual project id when requesting it, not the node-path

This commit is contained in:
Karsten Heiken
2011-04-22 13:16:44 +02:00
parent 8532a5d278
commit bdd469be32
2 changed files with 3 additions and 14 deletions

View File

@@ -64,7 +64,7 @@ class Projects extends CI_Controller {
// ->set_output(json_encode(array('count' => $count, 'projects' => $projects))); // ->set_output(json_encode(array('count' => $count, 'projects' => $projects)));
} }
public function detail($projects, $area, $id) { public function detail($project_id) {
$project = $this->project->get($id); $project = $this->project->get($id);
$this->output $this->output
->set_content_type('application/json') ->set_content_type('application/json')

View File

@@ -98,7 +98,7 @@ function logout() {
function loadProjectInfo(n) { function loadProjectInfo(n) {
if(n.isLeaf()){ if(n.isLeaf()){
Ext.Ajax.request({ Ext.Ajax.request({
url: BASE_URL + 'projects/detail' + n.id, url: BASE_URL + 'projects/detail/' + n.prjId,
method: 'get', method: 'get',
success: function ( result, request ) { success: function ( result, request ) {
@@ -107,21 +107,10 @@ function loadProjectInfo(n) {
tabPanel.add({ tabPanel.add({
title: 'New Tab ', title: 'New Tab ',
html: 'Lade Projekt...', html: 'Lade Projekt...',
closable:true, closable:true
handler: function(){
alert("foo");
var data = theResponse.result;
var tpl = new Ext.Template(
'<p>ID: {id}</p>',
'<p>Name: {name}</p>'
);
tpl.overwrite(this.html, data);
}
}).show(); }).show();
}, },
failure: function ( result, request ) { failure: function ( result, request ) {
//Ext.MessageBox.alert("Fehler!", "Das gewünschte Projekt kann nicht geladen werden.");
switch(result.status) { switch(result.status) {
case 404: case 404:
Ext.MessageBox.alert("Fehler", "Das gewünschte Projekt konnte nicht gefunden werden."); Ext.MessageBox.alert("Fehler", "Das gewünschte Projekt konnte nicht gefunden werden.");