Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Purushottam on Dec 21, 2009 03:15
open dhtmlx forum
grid cell auto complete like jquery auto complete

i want to autocomplete on key press of any cell this autocomplete like jquery autocomple. so please send the how i make a code
such that on cell type autocomplete like jquery.


mygrid = new dhtmlXGridObject('gridbox');
mygrid.imgURL='../dhtmlxGrid/Images/imgs/';
mygrid.setSkin("light");
mygrid.loadXML("dhtmlxGridLoad.aspx?page=packagesetting&code="+ "All"+ "");
mygrid.enableSmartRendering(true,20);
mygrid.enableCellIds(true);


// mygrid.enableAutoHeight(false);
// mygrid.enableAutoWidth(false);
mygrid.attachEvent("onEditCell",function(stage,rowId,cellInd){

if(stage==1)
{
var x=mygrid.cells(rowId,cellInd).cell.id;


$("#x").
autocomplete(

"ajax.aspx",
{
extraParams:
{
cou:function()
{
return $("#ctl00_ContentPlaceHolder1_txtcountryname").val();
alert($("#ctl00_ContentPlaceHolder1_txtcountryname").val());
},
supp:function()
{
return $("#ctl00_ContentPlaceHolder1_txtsuppliername").val();
} ,
page:function()
{
return "packagesetting";
},
box:function()
{
return "country";
},
}

});
}
if(stage==2)
{


var attr=mygrid.cells(rowId,cellInd).cell.id;
alert(attr);

}
return true;
})
myDataProcessor = new dataProcessor("dhtmlxGridLoad.aspx?mode=save&page=packagesetting&code="+ "All" +"");
myDataProcessor.setVerificator(1);
     myDataProcessor.setUpdateMode("on");
myDataProcessor.init(mygrid);


function save_data()
{
     myDataProcessor.sendData();
            
}
    myDataProcessor.attachEvent("onAfterUpdateFinish",function()
{
alert('Successfully Updated !!!!!!!!!!!!');

})


function newrows()
{


mygrid.addRow((new Date()).valueOf(),['','','','','','','','','',''],mygrid.getRowIndex(mygrid.getSelectedId()))
}
function getvalue()
{
alert(document.getElementById('<%=txtsuppliername.ClientID%>').value);
}


</script>
Answer posted by dhxSupport on Dec 21, 2009 05:36
Auto complete mode works only for "combo" eXcells. Please find example here http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/13_interaction_other_components/01_pro_combo.html