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_TopicIcon
navGrid buttons redirecting
25/09/2009
10:03
Avatar
viktor
Ushuaia, Tierra del Fuego
Member
Members
Forum Posts: 4
Member Since:
25/09/2009
sp_UserOfflineSmall Offline

Another question about navGrid buttons (add, edit, delete). It's possible to redirect to a page when I click one of this buttons?

IE: When I press the "edit" button, i would like it to redirect me to "www.server.com/edit.php?id=1"

Thanks!

25/09/2009
10:25
Avatar
viktor
Ushuaia, Tierra del Fuego
Member
Members
Forum Posts: 4
Member Since:
25/09/2009
sp_UserOfflineSmall Offline

I try the following:

<script type="text/javascript">
jojo = function() {
    alert('jojo');
}
$(document).ready(function()
{
    $("#list1").jqGrid({
        url:'{#ROOT_DIR#}/data/xml/filemanager-lista.php',
        datatype: "xml",
        colNames:['Desde','Archivo', 'Descripcion', 'Categorias', 'De', 'Para'],
        colModel:[
            {name:'Desde',index:'file_created', width:30},
            {name:'Archivo',index:'file_title', width:100, editable:true, editoptions:{size:25}},
            {name:'Descripcion',index:'file_desc', width:100},
            {name:'Categorias',index:'', width:100},
            {name:'De',index:'', width:40},
            {name:'Para',index:'',width:40}
        ],
        rowNum:10,
        autowidth: true,
        rowList:[10,20,30],
        pager: jQuery('#pager1'),
        sortname: 'file_created',
        viewrecords: true,
        sortorder: "desc",
        height: "300px"
    }).navGrid(
        '#pager1',
        {search:true}, // opciones
        {height:280, reloadAfterSubmit:false, beforeShowForm:jojo}, // opciones edicion
        {height:280, reloadAfterSubmit:false}, // opciones agregar
        {reloadAfterSubmit:false}, // opciones eliminar
        {searchtext:"Buscar..."} // opciones buscador
    )
});
</script>

Here, when you click on the "edit" button, it displays the "jojo" message alert.

Then I've tried:

<script type="text/javascript">
jojo = function(data) {
    alert('jojo '+data);
}
$(document).ready(function()
{
    $("#list1").jqGrid({
        url:'{#ROOT_DIR#}/data/xml/filemanager-lista.php',
        datatype: "xml",
        colNames:['Desde','Archivo', 'Descripcion', 'Categorias', 'De', 'Para'],
        colModel:[
            {name:'Desde',index:'file_created', width:30},
            {name:'Archivo',index:'file_title', width:100, editable:true, editoptions:{size:25}},
            {name:'Descripcion',index:'file_desc', width:100},
            {name:'Categorias',index:'', width:100},
            {name:'De',index:'', width:40},
            {name:'Para',index:'',width:40}
        ],
        rowNum:10,
        autowidth: true,
        rowList:[10,20,30],
        pager: jQuery('#pager1'),
        sortname: 'file_created',
        viewrecords: true,
        sortorder: "desc",
        height: "300px"
    }).navGrid(
        '#pager1',
        {search:true}, // opciones
        {height:280, reloadAfterSubmit:false, beforeShowForm:jojo(data)}, // opciones edicion
        {height:280, reloadAfterSubmit:false}, // opciones agregar
        {reloadAfterSubmit:false}, // opciones eliminar
        {searchtext:"Buscar..."} // opciones buscador
    )
});
</script>

... and... the message alert shows up before the grid.

Solutions?!!!! Thanksss!!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
94 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