 |
|
|
 |
 |
|
แล้วที่เป็น autocomplete จาาก db oracle ละคะเขยีนยังไงดีคะ
|
 |
 |
 |
 |
Date :
2012-01-22 14:08:27 |
By :
ying290385 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอบไปแล้วครับ
|
 |
 |
 |
 |
Date :
2012-01-22 17:25:33 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วถ้าจะรวมกับ code ใน web นี้ -> http://www.ninenik.com/content.php?arti_id=367
ควรจะแก้ยังไงดีค่ะหรือเพิ่มตรงไหนดีคะ พอดียังประยุกต์ไม่เป็นอ่ะค่ะ
|
 |
 |
 |
 |
Date :
2012-01-22 23:04:55 |
By :
ying290385 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเขียนดูก่อน ไม่ได้ค่อยมาถามครับ 
|
 |
 |
 |
 |
Date :
2012-01-23 05:56:14 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแล้วค่ะไม่ได้ค่ะ ไม่ทราบว่าต้องแก้อย่างไรคะ
Code (PHP)
var tmp = "";
<?
$sqllevel = ' select * from APPM_GRADUATE_LEVEL order by LEVEL_CODE asc ';
$rslevel = &$db->Execute($sqllevel);
while ($datale= $rslevel->FetchRow()) {
echo "tmpp +=\"\\\"".$datale['NAME']."\\\",\"\n";
}
?>
// alert(tmpp);
// auto complete
var availabletxtGraduateLevels_desc =[tmpp];
$( "#txtGraduateLevels_desc" ).autocomplete({
minLength: 0,
source: availabletxtGraduateLevels_desc,
open:function(){
var valInput=$(this).val();
if(valInput!=""){
$(".ui-menu-item a").each(function(){
var matcher = new RegExp("("+valInput+")", "ig" );
var s=$(this).text();
var newText=s.replace(matcher, "<b>$1</b>");
$(this).html(newText);
});
}
}
});
$( "<button type='button'> </button>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )
.addClass("myselectword")
.insertAfter("#txtGraduateLevels_desc")
.button({
icons: {
primary: "ui-icon-triangle-1-s"
},
text: false
})
.removeClass( "ui-corner-all" )
.addClass( "ui-corner-right ui-button-icon" )
.click(function() {
if ($( "#txtGraduateLevels_desc" ).autocomplete( "widget" ).is( ":visible" ) ) {
$( "#txtGraduateLevels_desc" ).autocomplete( "close" );
return;
}
$( "#txtGraduateLevels_desc" ).autocomplete( "search", "" );
$( "#txtGraduateLevels_desc" ).focus();
});
});
|
 |
 |
 |
 |
Date :
2012-01-23 08:55:50 |
By :
xx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
open:function(){
var valInput=$(this).val();
if(valInput!=""){
$(".ui-menu-item a").each(function(){
var matcher = new RegExp("^("+valInput+")", "m" );
var s=$(this).text();
var newText=s.replace(matcher, "<b>$1</b>");
$(this).html(newText);
});
}
}
อยากให้มัน search เฉพาะตัวแรกควรเปลี่ยนตรงไหนดีคะ เพราะลองเพิ่ม ^ แล้ว มันยัง search ทุกตัวในคำเลยค่ะ
|
 |
 |
 |
 |
Date :
2012-01-23 15:50:40 |
By :
ying |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|