ck_editor不加载实际数据

时间:2016-08-03 08:16:22

标签: php html5 ckeditor

为什么ck编辑器没有加载我在源模式下做的最后一次更改? 如果我已禁用ck_editor,则textarea将显示所有数据。 这是我的代码:

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
using XamarinFormsDemo.Models;
using XamarinFormsDemo.Services;
using XamarinFormsDemo.Views;

namespace XamarinFormsDemo.ViewModels
{
    public class CustomerVM : INotifyPropertyChanged
    {


        private List<Customer> _customerList; // keep all customers
        private List<Customer> _searchedCustomerList; // keep a copy for searching
        private Customer _selectedCustomer = new Customer();

        private string _keyword = "";
        public string Keyword
        {
            get
            {
                return _keyword;
            }
            set
            {
                this._keyword = value;

                // while keyword changed we filter Employees
                //Filter();
            }
        }



        private void Filter()
        {
            if (string.IsNullOrWhiteSpace(_keyword))
            {
                CustomerList = _searchedCustomerList;

            }
            else
            {
                // var lowerKeyword = _keyword.ToLower();
                CustomerList = _searchedCustomerList.Where(r => r.CUSTOMER_NAME.ToLower().Contains(_keyword.ToLower())).ToList();
                //  EmployeesList = _searchedEmployeesList.Where(r => r.EMPLOYEE_NAME.Contains(_keyword)).ToList();


            }
        }


        public List<Customer> CustomerList
        {
            get
            {
                return _customerList;
            }
            set
            {
                _customerList = value;
                OnPropertyChanged();
            }
        }



        public CustomerVM()
        {
            InitializeDataAsync();

        }

        private async Task InitializeDataAsync()
        {
            var customerServices = new CustomerServices();
            _searchedCustomerList = await customerServices.GetCustomerAsync();
            CustomerList = await customerServices.GetCustomerAsync();

        }




        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            var handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }

    }
}

2 个答案:

答案 0 :(得分:1)

它是关于CKEditor数据过滤和功能激活。

答案就在这里。 CKEditor automatically strips classes from div

答案 1 :(得分:0)

试试这个:

<textarea name="content" id="editor1" rows="10" cols="80">
      <?php print $selecteddata['content']; ?>
</textarea>

<script>
   $(window).load(function(){
      if (typeof(CKEDITOR.instances['content'])=='undefined') {
          CKEDITOR.replace( 'content',{
            filebrowserBrowseUrl : './public/browse.php',
            filebrowserUploadUrl : '/uploader/index.php',
            uiColor : '#9AB8F3'
         });
     }
  });
</script>