Ver Mensaje Individual
  #5 (permalink)  
Antiguo 18/01/2010, 20:57
LOD_Fredy
 
Fecha de Ingreso: abril-2009
Mensajes: 341
Antigüedad: 15 años
Puntos: 3
Respuesta: Ayuda con JQGrid y SqlDataSource

Lo que necesito es pasar los parametros de un sqldatasource al jqgrid pero sin usar el plugin de jqgrid, sino creando un script y enlazar el jqgrid creado desde el script con el sqldatasource.

Por ejemplo este script que viene en la pagina de jqgrid:

Código:
jQuery("#rowed1").jqGrid({ url:'server.php?q=2', datatype: "json", colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'], colModel:[ {name:'id',index:'id', width:55}, {name:'invdate',index:'invdate', width:90, editable:true}, {name:'name',index:'name', width:100,editable:true}, {name:'amount',index:'amount', width:80, align:"right",editable:true}, {name:'tax',index:'tax', width:80, align:"right",editable:true}, {name:'total',index:'total', width:80,align:"right",editable:true}, {name:'note',index:'note', width:150, sortable:false,editable:true} ], rowNum:10, rowList:[10,20,30], pager: '#prowed1', sortname: 'id', viewrecords: true, sortorder: "desc", editurl: "server.php", caption: "Basic Example" }); jQuery("#rowed1").jqGrid('navGrid',"#prowed1",{edit:false,add:false,del:false}); jQuery("#ed1").click( function() { jQuery("#rowed1").jqGrid('editRow',"13"); this.disabled = 'true'; jQuery("#sved1,#cned1").attr("disabled",false); }); jQuery("#sved1").click( function() { jQuery("#rowed1").jqGrid('saveRow',"13"); jQuery("#sved1,#cned1").attr("disabled",true); jQuery("#ed1").attr("disabled",false); }); jQuery("#cned1").click( function() { jQuery("#rowed1").jqGrid('restoreRow',"13"); jQuery("#sved1,#cned1").attr("disabled",true); jQuery("#ed1").attr("disabled",false); });
Yo utilizo esto:

Código:
<trirand:JQGrid runat="server" ID="JQGrid1" DataSourceID="SqlDataSource1" AppearanceSettings-Caption="TECNICOS"
     Width="600" Height="230" RenderingMode="Optimized" AddDialogSettings-LoadingMessageText="Cargando...">     
        <Columns>            
            <trirand:JQGridColumn HeaderText="No" DataField="num_tecnico" PrimaryKey="True" Width="5" TextAlign="Center" />
            <trirand:JQGridColumn HeaderText="Iniciales" DataField="iniciales" Editable="true" Width="5" TextAlign="Center" />
            <trirand:JQGridColumn HeaderText="Nombre" DataField="nombre" Editable="true" Width="25" TextAlign="Center" />
            <trirand:JQGridColumn HeaderText="Correo" DataField="correo" Editable="true" Width="20" TextAlign="Center" />                        
        </Columns>        
        <ToolBarSettings ShowEditButton="true" ShowRefreshButton="True" ShowAddButton="true" ShowDeleteButton="true"
            ShowSearchButton="True" />
    </trirand:JQGrid>
Pero al parecer hacer el script de js te permite mayores funcionalidades pero no se como enlazar el sqldatasource a lo que genera el script. Si se utiliza otra cosa que no sea un componente de .net pues diganme que se utiliza.