2010-03-03 4 views
3

필자는 지난 몇 일을 많이 jqgrids 덤비는되어 트러블 나는 거의 모든jQuery를/jqGrids/제출 양식 데이터는

임 원하는 내가 화면에서 원하는 방식으로, 다른 그리드와 탭 등이 모눈에서 요소를 추가하고 편집하는 데 Modal을 사용합니다. 임이 내 문제는 이것입니다. 나는 내 editurl을 가지고있다 : "editsu.php"set, 만약 그 파일의 이름이 바뀌면, 나는 modal에서 404를 얻는다. 그러나 해당 파일을 사용하면 아무 일도 일어나지 않을 것입니다. 나는 심지어 주사위를 굴린다. 라인 상단에, 그래서 파일을보고, 그냥 그걸로 아무것도하지 않습니다.

다음은 내용입니다. ........ 인덱스 페이지 editsu.php 파일에 대한 지금


jQuery("#landings").jqGrid({ 
    url:'server.php?tid=1', 
    datatype: "json", 
    colNames:['ID','Tower','Sector', 'Client', 'VLAN','IP','DLink','ULink','Service','Lines','Freq','Radio','Serial','Mac'], 
    colModel:[ 
     {name:'id', index:'id', width : 50, align: 'center', sortable:true,editable:true,editoptions:{size:10}}, 
     {name:'tower', index:'tower', width : 85, align: 'center', sortable:true,editable:false,editoptions:{readonly:true,size:30}}, 
     {name:'sector', index:'sector', width : 50, align: 'center',sortable:true,editable:true,editoptions:{readonly:true,size:20}}, 
     {name:'customer',index:'customer', width : 175, align: 'left', editable:true,editoptions:{readonly:true,size:35}}, 
     {name:'vlan', index:'vlan', width : 35, align: 'left',editable:true,editoptions:{size:10}}, 
     {name:'suip', index:'suip', width : 65, align: 'left',editable:true,editoptions:{size:20}}, 
     {name:'datadl',index:'datadl', width:55, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from datatypes"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}},  
     {name:'dataul', index:'dataul', width : 55, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from datatypes"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, 
     {name:'servicetype', index:'servicetype', width : 85, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from servicetype"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, 
     {name:'voicelines', index:'voicelines', width : 35, align: 'center',editable:true,editoptions:{size:30}}, 
     {name:'freqname', index:'freqname', width : 35, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from freqband"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, 
     {name:'radioname', index:'radioname', width : 120, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from radiotype"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, 
     {name:'serial', index:'serial', width : 100, align: 'right',editable:true,editoptions:{size:20}}, 
     {name:'mac', index:'mac', width : 120, align: 'right',editable:true,editoptions:{size:20}} 

    ], 
    rowNum:20, 
    rowList:[30,50,70], 
    pager: '#pagerl', 
    sortname: 'sid', 
    mtype: "GET", 
    viewrecords: true, 
    sortorder: "asc", 
    altRows: true, 
    caption:"Landings", 
    editurl:"editsu.php", 
    height:420 
    }); 
jQuery("#landings").jqGrid('navGrid','#pagerl',{edit:true,add:true,del:false,search:false},{height:400,reloadAfterSubmit:false},{height:400,reloadAfterSubmit:false},{reloadAfterSubmit:false},{}); 
..

$operation = $_REQUEST['oper']; 
if ($operation == "edit") { 
    qquery("UPDATE customers SET vlan = '".$_POST['vlan']."', datadl = '".$_POST['datadl']."', dataul = '".$_POST['dataul']."', servicetype = '".$_POST['servicetype']."', voicelines = '".$_POST['voicelines']."', freqname = '".$_POST['freqname']."', radioname = '".$_POST['radioname']."', serial = '".$_POST['serial']."', mac = '".$_POST['mac']."' WHERE id = '".$_POST['id']."'") or die(mysql_error()); 
} 

임은 힘든 시간을 알아 내기 위해이 문제를 해결하는 데 그 곳에 매달리는 곳.

내 다음 질문은 가능한 한 "추가"를 클릭하면 자동으로 몇 개의 변수가있는 db에 행을 삽입하고 모달 창을 표시하는 것입니다. 먼저 첫 번째 문제에 대한 부작용.

감사합니다.

+0

넣어'error_reporting를 (E_ALL)'. 간단한 PHP 오류 일 수 있습니다. – cmptrgeekken

답변

1

어디서나 콜백 기능이 표시되지 않습니다. server.php에서 응답이 반환되면 어떻게 될까요?

+0

업데이트 또는 추가 중 하나입니다. Id는 먼저 레코드 작업의 간단한 업데이트를 얻고 싶습니다. 그런 다음 내 다음 단계는 여러 단계의 추가 작업입니다. 여기에서 다른 고객의 데이터베이스를 검색합니다 (다른 SQL DB (이 코드는 이미 이전 프레임 워크에서 작동합니다. ,하지만 간단한 기능), 그것은 고객 ID를 반환합니다. 거기에서, 그들은 세부 사항의 나머지 부분을 채울 수 있습니다. 그래서,이 함수는 실종,이 그리드를 만들기 위해 JS로 이동합니까? – Kelso

+0

죄송합니다 . 너무 빠른 답변을 .. server.php 데이터를 반환하는 무엇입니까 그리드를 채 웁니다 .tid 결정하는 위치에 대한 데이터를로드합니다. 탭 플러그 인을 사용하여 내 그리드를 구분하는,하지만이 미래에 변경할 수 있습니다, – Kelso

+0

그것은 그리드에 게시 되겠지만, 내가 사라지 자마자 곧로드 될 것입니다. 그래서 콜백 함수가 누락되었습니다. 불행히도 따라야 할 좋은 예제가 없거나 어디로 가야할지 모릅니다. 봐 .. – Kelso

0

몇 가지 질문 : 호출이 editsu.php하는 후

  1. 은 당신의 데이터가 데이터베이스에 업데이트됩니까?
  2. Firebug의 네트워크 패널에서 요청/응답을 볼 수 있습니까? 당신의 PHP 페이지의 상단에

제롬