1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Answers
    1
    Vote Rating
    -6
    AtulDawkhare can only hope to improve

      0  

    Default Unanswered: Grid row Right click [Context menu] Open new url

    Unanswered: Grid row Right click [Context menu] Open new url


    Hi
    I have a code in which I am showing Grid and the on each row click there is Context menu like edit, delete.
    Now I want to open new page/ URL when I clicked on Edit option.

    I have attached the screen shot with this. Please have a look at it. So when I clicked on Edit Record I want this should open new page/ URL with parameters.

    ContextMenuURL.jpg


    My Code is something like this

    var grid = Ext.create('Ext.grid.Panel', {

    store: store,
    listeners:
    {
    itemcontextmenu: function(view,record,item,index,e,eOpts)
    {
    var menu= new Ext.menu.Menu();
    menu.add({text:"Edit Record",icon: 'css/images/add16.gif',handler:onClick(view,record,item,index,e,eOpts)});
    menu.add({text:"Copy Record",handler:
    function ()
    {

    var rec = store.getAt(index);


    var NewCompany=rec.get('company');
    var NewPrice=rec.get('price');
    var NewChange=rec.get('change');
    var NewPctChange=rec.get('pctChange');
    var NewLastChange=rec.get('lastChange');

    var r = Ext.ModelManager.create({
    company:NewCompany,
    price:NewPrice,
    change:NewChange,
    pctChange:NewPctChange,
    lastChange:NewLastChange
    }, 'TestForm');
    store.insert(0, r);
    }
    });
    menu.add({text:"Delete Record",handler://RowDelete(grid)
    function()
    {
    var sm = grid.getSelectionModel();
    store.remove(sm.getSelection());
    }
    });

    e.stopEvent();
    menu.showAt(e.xy);
    }
    },
    columnLines: false,
    Can anyone please suggest me the solution for this?

  2. #2
    Sencha User
    Join Date
    Sep 2011
    Posts
    27
    Answers
    3
    Vote Rating
    0
    arcan9ne is on a distinguished road

      0  

    Default


    try something like this maybe:

    Code:
    menu.add({
      text:"Edit Record",
      icon: 'css/images/add16.gif',
      handler: function(view,record,item,index,e,eOpts){
        // get the selected record
        var my_record = view.getSelectionModel().getLastSelected();
    
        // we will pass the company field as a paramater
        var my_record_param = my_record.data['company'];
      
      // let's create the url
      var my_url = 'http://www.myurlgoeshere.com/pass_parameter.php?p=' + my_record_param
    
      // now you can create a Ext.window and put an iframe with the url in the html like so..
        new Ext.Window({
          width: 500,
          height: 500,
          html: '<iframe width="300" height="300" src="' + my_url + '"</iframe>'
      }).show();
    
      // or do it the old fashion way
      window.open(my_url);
    });

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Answers
    1
    Vote Rating
    -6
    AtulDawkhare can only hope to improve

      0  

    Default


    Thanks a lot for this help

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi