Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
HOW TO? Display results of editoptions dataUrl with form editing?
29/09/2010
13:50
Avatar
Trober
Member
Members
Forum Posts: 21
Member Since:
14/09/2010
sp_UserOfflineSmall Offline

If editoptions dataUrl have problem how can server response  be displayed  on form editing?

Some times, server respond with message to user which is not ajax error.

errorTextFormat event not fired.

afterSubmit too late.

documentations we haven't found an event with server response we can display on bottominfo for example.

hope someone helps.  last message no one did.   Cry

thanks

06/10/2010
23:55
Avatar
Trober
Member
Members
Forum Posts: 21
Member Since:
14/09/2010
sp_UserOfflineSmall Offline

Noone knows or has answer?

07/10/2010
21:36
Avatar
bhneto
Rio de Janeiro
Member
Members
Forum Posts: 3
Member Since:
07/10/2010
sp_UserOfflineSmall Offline

Hi

I have a similar problem as u. I want to get a list of a SELECT through a .php and this list would to fill the editoptions of a select type.

My is here:

    $(document).ready(function(){
    jQuery("#tabAreaCompetencia").jqGrid({
          url:'areasConhecimento.php',
          datatype: "xml",
          colNames:['Código','Área Conhecimento', 'Código', 'Competência'],
          colModel:[
              {name:'codArea1',index:'codArea1', width:100,editable:true, editrules: { edithidden: true}},
              {name:'areaConhecimento1',index:'areaConhecimento1', width:150, editable:true, edittype:"select", editoptions:{value:"1:one;2:two"}},
              {name:'codCompetencia1',index:'codCompetencia1', width:100,editable:true,editrules: { edithidden: false}},
              {name:'competencia1',index:'competencia1', width:100,editable:true,edittype:"select", editoptions: { dataUrl : '{areasConhecimento.php}' }},
          ],
          rowNum:10,
          rowList:[10,20,30],
          pager: '#pagered',
          sortname: 'areaConhecimento',
          viewrecords: true,
          sortorder: "desc",
          caption:"Áreas de Conhecimento e Competências",
          editurl:"areasConhecimento.php"
    });

The column name 'competencia1' call .php... And the .php code is:

$sql = "SELECT conceito_id, descricao FROM area_conhecimento ORDER BY descricao ASC";
$res = mysql_query($sql);
$qtdeLinhas = mysql_num_rows($res);
$qtdeLinhas = $qtdeLinhas-1;
for ($i=0; $i<$qtdeLinhas; $i++){
    $registro = mysql_fetch_row($res);
    $cod = $registro[0];
    $nome = $registro[1];
    if ($i != $qtdeLinhas){
        $resultado = $cod .":". $nome .";";
    }
    if ($i == $qtdeLinhas){
            $resultado = $cod .":". $nome ."" ;
    }
    echo $resultado; 

}

I imagine that the variable $resultado should return the string in this format: “FE:FedEx; IN:InTime; TN:TNT”. But unfortunately, it doesn't work.

I already have tried using ajax this way:

Instead of : editoptions: { dataUrl : '{areasConhecimento.php}' }, I tried: editoptions: {value:obterAreaConhecimento()}. In the code .php I get the list with this line:

    $_POST['text'] = $resultado;

The function is:

    function obterAreaConhecimento(){
                urlConsultaArea = "./areasConhecimento.php";  
                $.ajax({
                    type:         "get",
                    url:         urlConsultaArea,
                    dataType:     "text",
                    success:     function(text){concatenaString(text)}
                })
    }
    function concatenaString(text){
        alert(text);
        var editoptions = text;            
        alert(editoptions);
        if (editoptions != ""){
        return editoptions;    
        }    
    }

Alert shows the string with strange characters (6.02.00.00-6:Administra��o;6.02.01.00-2:Administra��o de Empresas;6.02.03.00-5:Administra��o de Setores Espec) and the select in the grid remains empty.

So, these 2 forms doesn't work yet.

How did you do? Maybe can we help each other.

[]`s

15/10/2010
08:35
Avatar
Trober
Member
Members
Forum Posts: 21
Member Since:
14/09/2010
sp_UserOfflineSmall Offline

Seems noone knows. ???  

3 of 4 posts I have no answer on this forum.  Frown

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
65 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information